fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / libf2c / libI77 / rewind.c
blobd7a9b766192cc089221f4bf7753e9d481a358807
1 #include "config.h"
2 #include "f2c.h"
3 #include "fio.h"
4 integer
5 f_rew (alist * a)
7 unit *b;
8 if (f__init & 2)
9 f__fatal (131, "I/O recursion");
10 if (a->aunit >= MXUNIT || a->aunit < 0)
11 err (a->aerr, 101, "rewind");
12 b = &f__units[a->aunit];
13 if (b->ufd == NULL || b->uwrt == 3)
14 return (0);
15 if (!b->useek)
16 err (a->aerr, 106, "rewind");
17 if (b->uwrt)
19 (void) t_runc (a);
20 b->uwrt = 3;
22 FSEEK (b->ufd, 0, SEEK_SET);
23 b->uend = 0;
24 return (0);