1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-16 14:35:03 -05:00

make 'checkdied' in runtests.pl more robust

This commit is contained in:
Yang Tse 2007-11-23 12:18:45 +00:00
parent 3daa54d636
commit 5b809a3104

View File

@ -258,8 +258,11 @@ $ENV{'CURL_CA_BUNDLE'}=undef;
sub checkdied { sub checkdied {
use POSIX ":sys_wait_h"; use POSIX ":sys_wait_h";
my $pid = $_[0]; my $pid = $_[0];
if(not defined $pid || $pid <= 0) {
return 0;
}
my $rc = waitpid($pid, &WNOHANG); my $rc = waitpid($pid, &WNOHANG);
return $rc == $pid; return ($rc == $pid)?1:0;
} }
####################################################################### #######################################################################