added test for return val of now{r,w}. DLW
authorDavid Wasley <dlw@ucbvax.Berkeley.EDU>
Wed, 12 Aug 1981 14:26:43 +0000 (06:26 -0800)
committerDavid Wasley <dlw@ucbvax.Berkeley.EDU>
Wed, 12 Aug 1981 14:26:43 +0000 (06:26 -0800)
SCCS-vsn: usr.bin/f77/libI77/endfile.c 1.3

usr/src/usr.bin/f77/libI77/endfile.c

index 75f4145..37df6b4 100644 (file)
@@ -1,12 +1,12 @@
 /*
 /*
-char id_endfile[] = "@(#)endfile.c     1.2";
+char id_endfile[] = "@(#)endfile.c     1.3";
  *
  * endfile
  */
 
 #include "fio.h"
 
  *
  * endfile
  */
 
 #include "fio.h"
 
-char *endf = "endfile";
+char endf[] = "endfile";
 extern char *tmplate;
 
 f_end(a) alist *a;
 extern char *tmplate;
 
 f_end(a) alist *a;
@@ -32,7 +32,7 @@ t_runc(b,flag) unit *b; ioflag flag;
        int n,m;
        long loc,len;
        fflush(b->ufd);
        int n,m;
        long loc,len;
        fflush(b->ufd);
-       if(b->uwrt) nowreading(b);
+       if(b->uwrt && ! nowreading(b)) err(errflag, errno, endf);
        if(b->url || !b->useek || !b->ufnm) return(OK); /*don't trunc dir files*/
        loc=ftell(b->ufd);
        fseek(b->ufd,0L,2);
        if(b->url || !b->useek || !b->ufnm) return(OK); /*don't trunc dir files*/
        loc=ftell(b->ufd);
        fseek(b->ufd,0L,2);