If -o|logger is in use, exit trace loop if nprocs == 0.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
parent
d2e1f42d8a
commit
7c41ce2878
9
strace.c
9
strace.c
@ -1973,6 +1973,10 @@ trace(void)
|
||||
* 19923 exit_group(1) = ?
|
||||
* 19923 +++ exited with 1 +++
|
||||
* Waiting for ECHILD works better.
|
||||
* (However, if -o|logger is in use, we can't do that.
|
||||
* Can work around that by double-forking the logger,
|
||||
* but that loses the ability to wait for its completion on exit.
|
||||
* Oh well...)
|
||||
*/
|
||||
while (1) {
|
||||
int pid;
|
||||
@ -1985,6 +1989,9 @@ trace(void)
|
||||
if (interrupted)
|
||||
return;
|
||||
|
||||
if (popen_pid != 0 && nprocs == 0)
|
||||
return;
|
||||
|
||||
if (interactive)
|
||||
sigprocmask(SIG_SETMASK, &empty_set, NULL);
|
||||
pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL));
|
||||
@ -2343,7 +2350,7 @@ trace(void)
|
||||
exit_code = 1;
|
||||
return;
|
||||
}
|
||||
} /* while (nprocs != 0) */
|
||||
} /* while (1) */
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
x
Reference in New Issue
Block a user