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:
parent
4984f138f8
commit
0cab1fd236
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user