rewind: always clear error indicator.
Required by POSIX: http://pubs.opengroup.org/onlinepubs/009695399/functions/rewind.html Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 1 week
This commit is contained in:
parent
56b12303b3
commit
96faf15ff0
@ -53,9 +53,8 @@ rewind(FILE *fp)
|
||||
__sinit();
|
||||
|
||||
FLOCKFILE(fp);
|
||||
if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0) {
|
||||
clearerr_unlocked(fp);
|
||||
if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0)
|
||||
errno = serrno;
|
||||
}
|
||||
clearerr_unlocked(fp); /* POSIX: clear stdio error regardless */
|
||||
FUNLOCKFILE(fp);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user