diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-02-22 17:11:35 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-02-22 17:11:35 -0500 |
commit | a6238c30d169cbac6bc4c4977622242063e32270 (patch) | |
tree | 757a5b974e8c56c244895751d2c38a242bc336b6 /src/stdio/rewind.c | |
parent | 71e6be641fb1e4080c2bb901e83423546d0ad5af (diff) | |
download | musl-a6238c30d169cbac6bc4c4977622242063e32270.tar.gz musl-a6238c30d169cbac6bc4c4977622242063e32270.tar.xz musl-a6238c30d169cbac6bc4c4977622242063e32270.zip |
rewind must clear the error indicator in addition to seeking
Diffstat (limited to 'src/stdio/rewind.c')
-rw-r--r-- | src/stdio/rewind.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/stdio/rewind.c b/src/stdio/rewind.c index 7944b434..6f4b58b5 100644 --- a/src/stdio/rewind.c +++ b/src/stdio/rewind.c @@ -1,6 +1,9 @@ -#include <stdio.h> +#include "stdio_impl.h" void rewind(FILE *f) { - fseek(f, 0, SEEK_SET); + FLOCK(f); + __fseeko_unlocked(f, 0, SEEK_SET); + f->flags &= ~F_ERR; + FUNLOCK(f); } |