From: Dmitry V. Levin Date: Fri, 2 Jun 2017 20:01:31 +0000 (+0000) Subject: strace.c: remove dead code X-Git-Tag: v4.18~142 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a1a41cb7e24efcb579c46c6722a622b30a98aae;p=strace strace.c: remove dead code As strace does not use WCONTINUED flag, there is no need to handle WIFCONTINUED status. * strace.c (print_debug_info) [WIFCONTINUED]: Remove. (next_event): Remove redundant !WIFSTOPPED check. --- diff --git a/strace.c b/strace.c index 047f4a7a..aa6d5388 100644 --- a/strace.c +++ b/strace.c @@ -2026,11 +2026,6 @@ print_debug_info(const int pid, int status) sprintf(buf, "WIFEXITED,exitcode=%u", WEXITSTATUS(status)); if (WIFSTOPPED(status)) sprintf(buf, "WIFSTOPPED,sig=%s", signame(WSTOPSIG(status))); -#ifdef WIFCONTINUED - /* Should never be seen */ - if (WIFCONTINUED(status)) - strcpy(buf, "WIFCONTINUED"); -#endif evbuf[0] = '\0'; if (event != 0) { static const char *const event_names[] = { @@ -2406,15 +2401,11 @@ next_event(int *pstatus, siginfo_t *si) if (WIFEXITED(status)) return TE_EXITED; - if (!WIFSTOPPED(status)) { - /* - * Neither signalled, exited or stopped. - * How could that be? - */ - error_msg("pid %u not stopped!", pid); - droptcb(tcp); - return TE_NEXT; - } + /* + * As WCONTINUED flag has not been specified to wait4, + * it cannot be WIFCONTINUED(status), so the only case + * that remains is WIFSTOPPED(status). + */ /* Is this the very first time we see this tracee stopped? */ if (tcp->flags & TCB_STARTUP)