summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2014-07-22 16:10:56 +0000
committerpfg <pfg@FreeBSD.org>2014-07-22 16:10:56 +0000
commit96faf15ff009431d95f6b86f4f203a71df6a0448 (patch)
treea964a12ddc6a6af7c9639244c2ef48792c29d1be /lib/libc
parent56b12303b39ff7cae687b8200156dcf50a31eb3f (diff)
downloadFreeBSD-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.c5
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);
}
OpenPOWER on IntegriCloud