@@ -32,7 +32,12 @@ function test_exit_signal(){
32
32
$ options =0 ;
33
33
posix_kill ($ pid , SIGTERM );
34
34
pcntl_waitpid ($ pid , &$ status , $ options );
35
- if ( pcntl_wifsignaled ($ status ) ) print "\nProcess was terminated by signal : " . pcntl_wtermsig ($ status );
35
+ if ( pcntl_wifsignaled ($ status ) ) {
36
+ $ signal_print =pcntl_wtermsig ($ status );
37
+ if ($ signal_print ==SIGTERM ) $ signal_print ="SIGTERM " ;
38
+ print "\nProcess was terminated by signal : " . $ signal_print ;
39
+ }
40
+
36
41
}
37
42
}
38
43
@@ -49,7 +54,11 @@ function test_stop_signal(){
49
54
$ options =WUNTRACED ;
50
55
posix_kill ($ pid , SIGSTOP );
51
56
pcntl_waitpid ($ pid , &$ status , $ options );
52
- if ( pcntl_wifstopped ($ status ) ) print "\nProcess was stoped by signal : " . pcntl_wstopsig ($ status );
57
+ if ( pcntl_wifstopped ($ status ) ) {
58
+ $ signal_print =pcntl_wstopsig ($ status );
59
+ if ($ signal_print ==SIGSTOP ) $ signal_print ="SIGSTOP " ;
60
+ print "\nProcess was stoped by signal : " . $ signal_print ;
61
+ }
53
62
posix_kill ($ pid , SIGCONT );
54
63
}
55
64
}
@@ -66,7 +75,7 @@ Testing pcntl_wifexited and wexitstatus....-1
66
75
Exited With: -1
67
76
68
77
Testing pcntl_wifsignaled....
69
- Process was terminated by signal : 15
78
+ Process was terminated by signal : SIGTERM
70
79
71
80
Testing pcntl_wifstopped and pcntl_wstopsig....
72
- Process was stoped by signal : 19
81
+ Process was stoped by signal : SIGSTOP
0 commit comments