summaryrefslogtreecommitdiff
path: root/ext/pcntl/tests
diff options
context:
space:
mode:
authorJason Greene <jason@php.net>2001-07-06 18:30:38 +0000
committerJason Greene <jason@php.net>2001-07-06 18:30:38 +0000
commitbe8b7f998133bd5b892013bfe107f3c2269ab4ba (patch)
tree3747c6be3fead5fe335e8ddc43eb5c4092d0b90e /ext/pcntl/tests
parent805c76f7420879b02f6badf02aebc94e8d6a86e5 (diff)
downloadphp-git-be8b7f998133bd5b892013bfe107f3c2269ab4ba.tar.gz
Signal numbers are not uniform accross all platforms.
Modified test to use the constants unless a failure occurs.
Diffstat (limited to 'ext/pcntl/tests')
-rw-r--r--ext/pcntl/tests/001.phpt17
1 files changed, 13 insertions, 4 deletions
diff --git a/ext/pcntl/tests/001.phpt b/ext/pcntl/tests/001.phpt
index d2f9923b95..ebcf17bbe9 100644
--- a/ext/pcntl/tests/001.phpt
+++ b/ext/pcntl/tests/001.phpt
@@ -32,7 +32,12 @@ function test_exit_signal(){
$options=0;
posix_kill($pid, SIGTERM);
pcntl_waitpid($pid, &$status, $options);
- if ( pcntl_wifsignaled($status) ) print "\nProcess was terminated by signal : ". pcntl_wtermsig($status);
+ if ( pcntl_wifsignaled($status) ) {
+ $signal_print=pcntl_wtermsig($status);
+ if ($signal_print==SIGTERM) $signal_print="SIGTERM";
+ print "\nProcess was terminated by signal : ". $signal_print;
+ }
+
}
}
@@ -49,7 +54,11 @@ function test_stop_signal(){
$options=WUNTRACED;
posix_kill($pid, SIGSTOP);
pcntl_waitpid($pid, &$status, $options);
- if ( pcntl_wifstopped($status) ) print "\nProcess was stoped by signal : ". pcntl_wstopsig($status);
+ if ( pcntl_wifstopped($status) ) {
+ $signal_print=pcntl_wstopsig($status);
+ if ($signal_print==SIGSTOP) $signal_print="SIGSTOP";
+ print "\nProcess was stoped by signal : ". $signal_print;
+ }
posix_kill($pid, SIGCONT);
}
}
@@ -66,7 +75,7 @@ Testing pcntl_wifexited and wexitstatus....-1
Exited With: -1
Testing pcntl_wifsignaled....
-Process was terminated by signal : 15
+Process was terminated by signal : SIGTERM
Testing pcntl_wifstopped and pcntl_wstopsig....
-Process was stoped by signal : 19
+Process was stoped by signal : SIGSTOP