From: Yang Tse Date: Fri, 23 Nov 2007 12:18:45 +0000 (+0000) Subject: make 'checkdied' in runtests.pl more robust X-Git-Tag: curl-7_18_0~231 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b809a31047111dab9dd11f48f2bb7db00f0e23e;p=thirdparty%2Fcurl.git make 'checkdied' in runtests.pl more robust --- diff --git a/tests/runtests.pl b/tests/runtests.pl index f2ed1650da..9e5a8674c1 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -258,8 +258,11 @@ $ENV{'CURL_CA_BUNDLE'}=undef; sub checkdied { use POSIX ":sys_wait_h"; my $pid = $_[0]; + if(not defined $pid || $pid <= 0) { + return 0; + } my $rc = waitpid($pid, &WNOHANG); - return $rc == $pid; + return ($rc == $pid)?1:0; } #######################################################################