]> granicus.if.org Git - strace/commitdiff
Trivial simplification
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 9 Mar 2012 14:34:16 +0000 (15:34 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 9 Mar 2012 14:34:16 +0000 (15:34 +0100)
* strace.c (detach): Use waitpid instead of wait4.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
strace.c

index 89a7dc9d3db5bd813b2ec4b1ef3edd9318013c4a..c662c5875f0e68893066668440068bc88f91ac92 100644 (file)
--- 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;