소스 검색

rewind must clear the error indicator in addition to seeking

Rich Felker 14 년 전
부모
커밋
a6238c30d1
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      src/stdio/rewind.c

+ 5 - 2
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);
 }