From: Michael Stapelberg Date: Sat, 11 Aug 2012 22:22:17 +0000 (+0200) Subject: testworker: handle EAGAIN X-Git-Tag: 4.3~112 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ae88accf6fe3817ff42d0d51be1965071194766e;p=i3%2Fi3 testworker: handle EAGAIN Hopefully this fixes the case where a testworker would die and leave the whole testsuite run hanging in the air, never completing. --- diff --git a/testcases/lib/TestWorker.pm b/testcases/lib/TestWorker.pm index a224b718..140537d4 100644 --- a/testcases/lib/TestWorker.pm +++ b/testcases/lib/TestWorker.pm @@ -8,6 +8,8 @@ use IO::Handle; # for ->autoflush use POSIX (); +use Errno qw(EAGAIN); + use Exporter 'import'; our @EXPORT = qw(worker worker_next); @@ -74,7 +76,12 @@ sub worker_wait { my $ipc = $self->{ipc}; my $ipc_fd = fileno($ipc); - while (defined(my $file = $ipc->getline)) { + while (1) { + my $file = $ipc->getline; + if (!defined($file)) { + next if $! == EAGAIN; + last; + } chomp $file; exit unless $file;