From a6238c30d169cbac6bc4c4977622242063e32270 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 22 Feb 2011 17:11:35 -0500 Subject: rewind must clear the error indicator in addition to seeking --- src/stdio/rewind.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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 +#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); } -- cgit v1.2.1