diff options
author | Yang Tse <yangsita@gmail.com> | 2007-11-23 12:18:45 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-11-23 12:18:45 +0000 |
commit | 5b809a31047111dab9dd11f48f2bb7db00f0e23e (patch) | |
tree | 29f735ec1d548ed8813c12d2dba1cfcf455022b4 | |
parent | 3daa54d636f736635e03f5a896ba66f64477592d (diff) |
make 'checkdied' in runtests.pl more robust
-rwxr-xr-x | tests/runtests.pl | 5 |
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; } ####################################################################### |