From 2c8a2583612f4df2a93cb8d180aadda4e93ec1dd Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 21 Jan 2009 19:05:43 +0000 Subject: [PATCH] * strace.c (collect_stopped_tcbs): Do not return NULL when ECHILD is detected, return collected list instead. Fixes symptom when the last "+++ killed by SIGxxx +++" is not printed. --- ChangeLog | 6 ++++++ strace.c | 22 ++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8bedc90b..5f0da0d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-01-21 Denys Vlasenko + + * strace.c (collect_stopped_tcbs): Do not return NULL when ECHILD + is detected, return collected list instead. Fixes symptom when + the last "+++ killed by SIGxxx +++" is not printed. + 2009-01-17 Denys Vlasenko Two cleanups: tcb table expansion failure is not really a survivable diff --git a/strace.c b/strace.c index 40d1e8d5..6620dd6e 100644 --- a/strace.c +++ b/strace.c @@ -2309,10 +2309,9 @@ collect_stopped_tcbs(void) break; } if (pid == -1) { - switch (wait_errno) { - case EINTR: + if (wait_errno == EINTR) continue; - case ECHILD: + if (wait_errno == ECHILD) { /* * We would like to verify this case * but sometimes a race in Solbourne's @@ -2320,17 +2319,16 @@ collect_stopped_tcbs(void) * ECHILD before sending us SIGCHILD. */ #if 0 - if (nprocs == 0) - return NULL; - fprintf(stderr, "strace: proc miscount\n"); - exit(1); + if (nprocs != 0) { + fprintf(stderr, "strace: proc miscount\n"); + exit(1); + } #endif - return NULL; - default: - errno = wait_errno; - perror("strace: wait"); - exit(1); + break; } + errno = wait_errno; + perror("strace: wait"); + exit(1); } if (pid == popen_pid) { if (WIFEXITED(status) || WIFSIGNALED(status)) -- 2.40.0