[6376] in Athena Bugs
/bin/size error message
daemon@ATHENA.MIT.EDU (John Carr)
Sat Nov 10 21:07:23 1990
To: bugs@ATHENA.MIT.EDU
Date: Sat, 10 Nov 90 21:07:06 EST
From: John Carr <jfc@ATHENA.MIT.EDU>
Size prints "<file> not found" for any error opening a file. It
should say what the error is.
*** /source/bsd-4.3/common/bin/size.c Sun Jul 15 15:32:30 1990
--- size.c Sat Nov 10 21:04:32 1990
***************
*** 5,10 ****
--- 5,11 ----
#include <stdio.h>
#include <a.out.h>
+ #include <errno.h>
int header;
***************
*** 13,19 ****
{
struct exec buf;
long sum;
! int gorp,i;
int err = 0;
FILE *f;
--- 14,20 ----
{
struct exec buf;
long sum;
! int gorp;
int err = 0;
FILE *f;
***************
*** 26,32 ****
while(--argc) {
++argv;
if ((f = fopen(*argv, "r"))==NULL) {
! fprintf(stderr, "size: %s not found\n", *argv);
err++;
continue;
}
--- 27,35 ----
while(--argc) {
++argv;
if ((f = fopen(*argv, "r"))==NULL) {
! fprintf(stderr, "size: unable to open %s: %s\n",
! *argv,
! errno > sys_nerr ? "unknown error" : sys_errlist[errno]);
err++;
continue;
}