diff options
author | pfg <pfg@FreeBSD.org> | 2014-07-22 16:10:56 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2014-07-22 16:10:56 +0000 |
commit | 96faf15ff009431d95f6b86f4f203a71df6a0448 (patch) | |
tree | a964a12ddc6a6af7c9639244c2ef48792c29d1be /lib/libc | |
parent | 56b12303b39ff7cae687b8200156dcf50a31eb3f (diff) | |
download | FreeBSD-src-96faf15ff009431d95f6b86f4f203a71df6a0448.zip FreeBSD-src-96faf15ff009431d95f6b86f4f203a71df6a0448.tar.gz |
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
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdio/rewind.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/stdio/rewind.c b/lib/libc/stdio/rewind.c index ff4c907..133e3f4 100644 --- a/lib/libc/stdio/rewind.c +++ b/lib/libc/stdio/rewind.c @@ -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); } |