summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/stdio.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-09-01 11:21:28 +0000
committerache <ache@FreeBSD.org>2001-09-01 11:21:28 +0000
commit625f4c5432005830b7f8ae203a8ed7bdcbf67bb0 (patch)
tree49a1657a4de0774a1f328366f4f374f654050ed7 /lib/libc/stdio/stdio.c
parent116ee96d9df70379bb81e6984c869556395bd5fd (diff)
downloadFreeBSD-src-625f4c5432005830b7f8ae203a8ed7bdcbf67bb0.zip
FreeBSD-src-625f4c5432005830b7f8ae203a8ed7bdcbf67bb0.tar.gz
If lseek to wrong value sucessfully happens despite all pre-checks, set __SERR
to indicate that stream becomes inconsistent.
Diffstat (limited to 'lib/libc/stdio/stdio.c')
-rw-r--r--lib/libc/stdio/stdio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c
index 46dd2df..ea8a4c1 100644
--- a/lib/libc/stdio/stdio.c
+++ b/lib/libc/stdio/stdio.c
@@ -118,8 +118,10 @@ __sseek(cookie, offset, whence)
* (fseek) in the cases it can't detect.
*/
if (ret < 0) {
- if (errret == 0)
+ if (errret == 0) {
+ fp->_flags |= __SERR;
errno = EINVAL;
+ }
fp->_flags &= ~__SOFF;
ret = -1;
} else {
OpenPOWER on IntegriCloud