]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vircommand: fix polling in virCommandProcessIO
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Tue, 21 Apr 2015 17:11:32 +0000 (20:11 +0300)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Wed, 22 Apr 2015 14:56:53 +0000 (17:56 +0300)
commite34cccf783983e1b19f139bde873e950424a8778
tree8acd193c187b0e8c6df4ec3716c4f9a539aad468
parentdff92b3f2fe63da63391f929134b06d3be992a40
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.
src/util/vircommand.c