aboutsummaryrefslogtreecommitdiff
path: root/tests/runtests.pl
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-11-23 12:18:45 +0000
committerYang Tse <yangsita@gmail.com>2007-11-23 12:18:45 +0000
commit5b809a31047111dab9dd11f48f2bb7db00f0e23e (patch)
tree29f735ec1d548ed8813c12d2dba1cfcf455022b4 /tests/runtests.pl
parent3daa54d636f736635e03f5a896ba66f64477592d (diff)
make 'checkdied' in runtests.pl more robust
Diffstat (limited to 'tests/runtests.pl')
-rwxr-xr-xtests/runtests.pl5
1 files changed, 4 insertions, 1 deletions
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;
}
#######################################################################