SCCS-vsn: usr.bin/f77/libI77/endfile.c 1.3
-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";
extern char *tmplate;
f_end(a) alist *a;
extern char *tmplate;
f_end(a) alist *a;
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);