From 128be91e61347b01ba97af54fb6f94e6e2638141 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 8 Jan 2009 06:38:06 +0000 Subject: Set the error indicator on an attempt to write to a read-only stream. PR: 127335 MFC after: 2 weeks --- lib/libc/stdio/wsetup.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/libc/stdio') 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) { -- cgit v1.1