From 5b809a31047111dab9dd11f48f2bb7db00f0e23e Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 23 Nov 2007 12:18:45 +0000 Subject: make 'checkdied' in runtests.pl more robust --- tests/runtests.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/runtests.pl b/tests/runtests.pl index f2ed1650d..9e5a8674c 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; } ####################################################################### -- cgit v1.2.3