From: Denys Vlasenko Date: Fri, 9 Mar 2012 14:34:16 +0000 (+0100) Subject: Trivial simplification X-Git-Tag: v4.7~135 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37ab4b79de57c1657e41f96a96fa699a08194a80;p=strace Trivial simplification * strace.c (detach): Use waitpid instead of wait4. Signed-off-by: Denys Vlasenko --- diff --git a/strace.c b/strace.c index 89a7dc9d..c662c587 100644 --- a/strace.c +++ b/strace.c @@ -1489,7 +1489,7 @@ detach(struct tcb *tcp) if (sigstop_expected) { for (;;) { #ifdef __WALL - if (wait4(tcp->pid, &status, __WALL, NULL) < 0) { + if (waitpid(tcp->pid, &status, __WALL) < 0) { if (errno == ECHILD) /* Already gone. */ break; if (errno != EINVAL) { @@ -1505,8 +1505,7 @@ detach(struct tcb *tcp) } #ifdef __WCLONE /* If no processes, try clones. */ - if (wait4(tcp->pid, &status, __WCLONE, - NULL) < 0) { + if (waitpid(tcp->pid, &status, __WCLONE) < 0) { if (errno != ECHILD) perror("detach: waiting"); break;