mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-31 16:57:10 +00:00
Only set _w to 0 when the file stream is not currently reading. Without
this fflush may fail to write data in the buffer. PR: kern/137819 Submitted by: Eric Blake <ebb9@byu.net> Reviewed by: theraven Approved by: cperciva MFC after: 2 weeks
This commit is contained in:
parent
af57f4cf56
commit
e5d9109aab
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236288
@ -62,7 +62,7 @@ fpurge(fp)
|
||||
FREEUB(fp);
|
||||
fp->_p = fp->_bf._base;
|
||||
fp->_r = 0;
|
||||
fp->_w = fp->_flags & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
|
||||
fp->_w = fp->_flags & (__SLBF|__SNBF|__SRD) ? 0 : fp->_bf._size;
|
||||
retval = 0;
|
||||
}
|
||||
FUNLOCKFILE(fp);
|
||||
|
Loading…
Reference in New Issue
Block a user