精简代码

This commit is contained in:
xiongziliang 2020-05-14 10:23:12 +08:00
parent d27a8117e1
commit 0e9d8df2d0

View File

@ -143,7 +143,7 @@ static bool s_wait(pid_t pid,int *exit_code_ptr,bool block) {
pid_t p = waitpid(pid, &status, block ? 0 : WNOHANG); pid_t p = waitpid(pid, &status, block ? 0 : WNOHANG);
int exit_code = (status & 0xFF00) >> 8; int exit_code = (status & 0xFF00) >> 8;
if (exit_code_ptr) { if (exit_code_ptr) {
*exit_code_ptr = (status & 0xFF00) >> 8; *exit_code_ptr = exit_code;
} }
if (p < 0) { if (p < 0) {
WarnL << "waitpid failed, pid=" << pid << ", err=" << get_uv_errmsg(); WarnL << "waitpid failed, pid=" << pid << ", err=" << get_uv_errmsg();