mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
vircommand: fix polling in virCommandProcessIO
When running on FreeBSD, there's a bug in virCommandProcessIO
polling that is triggered by the commandtest.
A test that triggers EPIPE in commandtest (named "test20") hungs
forever on FreeBSD.
Apparently, this happens because FreeBSD sets POLLHUP flag on revents
when stdin in closed. And as the current implementation only checks for
POLLOUT and POLLERR, it ends up looping forever inside
virCommandProcessIO and not trying to do one more write() that would
trigger EPIPE.
To fix that check for the POLLHUP flag along with POLLOUT and POLLERR.
(cherry picked from commit e34cccf783
)
This commit is contained in:
parent
e84e5aa3df
commit
b5a210dce7
@ -2073,7 +2073,7 @@ virCommandProcessIO(virCommandPtr cmd)
|
||||
}
|
||||
}
|
||||
|
||||
if (fds[i].revents & (POLLOUT | POLLERR) &&
|
||||
if (fds[i].revents & (POLLOUT | POLLHUP | POLLERR) &&
|
||||
fds[i].fd == cmd->inpipe) {
|
||||
int done;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user