zos: don't err when killing a zombie process (#3625)
On z/OS, EPERM is returned if the process being killed is a zombie. However, this shouldn't be treated as an error, so return 0 instead. Co-authored-by: Muntasir Mallick <mmallick@ca.ibm.com> Co-authored-by: Gaby Baghdadi <baghdadi@ca.ibm.com>
This commit is contained in:
parent
99ab53e998
commit
51dcac5da7
@ -1063,9 +1063,16 @@ int uv_process_kill(uv_process_t* process, int signum) {
|
||||
|
||||
|
||||
int uv_kill(int pid, int signum) {
|
||||
if (kill(pid, signum))
|
||||
if (kill(pid, signum)) {
|
||||
#if defined(__MVS__)
|
||||
/* EPERM is returned if the process is a zombie. */
|
||||
siginfo_t infop;
|
||||
if (errno == EPERM &&
|
||||
waitid(P_PID, pid, &infop, WNOHANG | WNOWAIT | WEXITED) == 0)
|
||||
return 0;
|
||||
#endif
|
||||
return UV__ERR(errno);
|
||||
else
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user