Commit | Line | Data |
---|---|---|
cf9cb894 | 1 | /* |
161423a6 RE |
2 | * Copyright (c) 1980 Regents of the University of California. |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
cf9cb894 | 5 | * |
489094e6 | 6 | * @(#)endfile.c 5.2 %G% |
161423a6 RE |
7 | */ |
8 | ||
9 | /* | |
cf9cb894 DW |
10 | * endfile |
11 | */ | |
12 | ||
13 | #include "fio.h" | |
14 | ||
bfcf9652 | 15 | static char endf[] = "endfile"; |
cf9cb894 | 16 | |
bfcf9652 DW |
17 | f_end (a) |
18 | alist *a; | |
cf9cb894 | 19 | { |
bfcf9652 | 20 | unit *b; |
489094e6 | 21 | int n; |
bfcf9652 | 22 | |
cf9cb894 DW |
23 | lfname = NULL; |
24 | elist = NO; | |
25 | errflag = a->aerr; | |
26 | lunit = a->aunit; | |
bfcf9652 DW |
27 | if (not_legal(lunit)) |
28 | err (errflag, F_ERUNIT, endf) | |
cf9cb894 | 29 | b = &units[lunit]; |
489094e6 JB |
30 | if(!b->ufd && (n = fk_open(READ, SEQ, FMT, (ftnint)lunit)) ) |
31 | err(errflag, n, endf); | |
bfcf9652 DW |
32 | if (b->uend) |
33 | return(0); | |
cf9cb894 DW |
34 | lfname = b->ufnm; |
35 | b->uend = YES; | |
331ef099 | 36 | return ( t_runc (b, errflag, endf) ); |
cf9cb894 | 37 | } |