File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -129,9 +129,20 @@ function (): iterable {
129129 }
130130 $ desc = $ parentPids [$ res ];
131131 unset($ parentPids [$ res ]);
132- if ($ status !== 0 ) {
132+ if (pcntl_wifexited ($ status )) {
133+ $ status = pcntl_wexitstatus ($ status );
133134 printMutex ("Child $ desc exited with status $ status " );
134- $ finalStatus = $ status ;
135+ if ($ status !== 0 ) {
136+ $ finalStatus = $ status ;
137+ }
138+ } elseif (pcntl_wifstopped ($ status )) {
139+ $ status = pcntl_wstopsig ($ status );
140+ printMutex ("Child $ desc stopped by signal $ status " );
141+ $ finalStatus = 1 ;
142+ } elseif (pcntl_wifsignaled ($ status )) {
143+ $ status = pcntl_wtermsig ($ status );
144+ printMutex ("Child $ desc terminated by signal $ status " );
145+ $ finalStatus = 1 ;
135146 }
136147};
137148
You can’t perform that action at this time.
0 commit comments