Set the error indicator on an attempt to write to a read-only stream.

PR:		127335
MFC after:	2 weeks
This commit is contained in:
das 2009-01-08 06:38:06 +00:00
parent f72abde4fb
commit 128be91e61

View File

@ -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) {