diff options
author | das <das@FreeBSD.org> | 2009-01-08 06:38:06 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2009-01-08 06:38:06 +0000 |
commit | 128be91e61347b01ba97af54fb6f94e6e2638141 (patch) | |
tree | ddb90a35fdff5f40c47edebf5aa02c0e601ee97e /lib/libc | |
parent | f72abde4fb0c07692e29a33cfbfba6e29eaceb67 (diff) | |
download | FreeBSD-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.c | 1 |
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) { |