svn commit: r186887 - head/lib/libc/stdio
David Schultz
das at FreeBSD.org
Wed Jan 7 22:38:08 PST 2009
Author: das
Date: Thu Jan 8 06:38:06 2009
New Revision: 186887
URL: http://svn.freebsd.org/changeset/base/186887
Log:
Set the error indicator on an attempt to write to a read-only stream.
PR: 127335
MFC after: 2 weeks
Modified:
head/lib/libc/stdio/wsetup.c
Modified: head/lib/libc/stdio/wsetup.c
==============================================================================
--- head/lib/libc/stdio/wsetup.c Thu Jan 8 06:12:03 2009 (r186886)
+++ head/lib/libc/stdio/wsetup.c Thu Jan 8 06:38:06 2009 (r186887)
@@ -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) {
More information about the svn-src-head
mailing list