summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2009-01-08 06:38:06 +0000
committerdas <das@FreeBSD.org>2009-01-08 06:38:06 +0000
commit128be91e61347b01ba97af54fb6f94e6e2638141 (patch)
treeddb90a35fdff5f40c47edebf5aa02c0e601ee97e /lib/libc
parentf72abde4fb0c07692e29a33cfbfba6e29eaceb67 (diff)
downloadFreeBSD-src-128be91e61347b01ba97af54fb6f94e6e2638141.zip
FreeBSD-src-128be91e61347b01ba97af54fb6f94e6e2638141.tar.gz
Set the error indicator on an attempt to write to a read-only stream.
PR: 127335 MFC after: 2 weeks
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdio/wsetup.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libc/stdio/wsetup.c b/lib/libc/stdio/wsetup.c
index a5da23f..37bfc58 100644
--- a/lib/libc/stdio/wsetup.c
+++ b/lib/libc/stdio/wsetup.c
@@ -60,6 +60,7 @@ __swsetup(fp)
if ((fp->_flags & __SWR) == 0) {
if ((fp->_flags & __SRW) == 0) {
errno = EBADF;
+ fp->_flags |= __SERR;
return (EOF);
}
if (fp->_flags & __SRD) {
OpenPOWER on IntegriCloud