VFS: fix interruption of blocking pipe operations
POSIX states that when interrupted, partially successful pipe operations should return the partial result rather than EINTR. VFS previously wouldn't look at the partial result, and not clear it either, which would result in a panic upon the next pipe operation. Change-Id: Ia1eb72b4b77394051444e63a1390d49bb315eb04
This commit is contained in:
parent
2af99c141d
commit
1e7b45c682
1 changed files with 9 additions and 0 deletions
|
@ -548,6 +548,15 @@ void unpause(void)
|
|||
|
||||
switch (blocked_on) {
|
||||
case FP_BLOCKED_ON_PIPE:/* process trying to read or write a pipe */
|
||||
/* If the operation succeeded partially, return the bytes
|
||||
* processed so far, and clear the remembered state. Otherwise,
|
||||
* return EINTR as usual.
|
||||
*/
|
||||
if (fp->fp_cum_io_partial > 0) {
|
||||
status = fp->fp_cum_io_partial;
|
||||
|
||||
fp->fp_cum_io_partial = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case FP_BLOCKED_ON_LOCK:/* process trying to set a lock with FCNTL */
|
||||
|
|
Loading…
Reference in a new issue