Trivial simplification

* strace.c (detach): Use waitpid instead of wait4.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2012-03-09 15:34:16 +01:00
parent f20250266e
commit 37ab4b79de

View File

@ -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;