]> granicus.if.org Git - strace/commitdiff
Trivial cleanups
authorDenys Vlasenko <dvlasenk@redhat.com>
Fri, 24 Jun 2011 21:01:57 +0000 (23:01 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Fri, 24 Jun 2011 21:01:57 +0000 (23:01 +0200)
* strace.c (trace): Change ifdef LINUX to make a bit more sense,
  remove wrong comment at its endif. Slightly optimize
  "+++ killed by SIG +++" message for systems without WCOREDUMP macro.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
strace.c

index bc1b00ec4b1c7fad409c4a3188596ad2722c132e..7314d4ade4932702d4c6d214c17c07ec99ddafac 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -2488,12 +2488,12 @@ Process %d attached (waiting for parent)\n",
                /* set current output file */
                outf = tcp->outf;
                curcol = tcp->curcol;
-               if (cflag) {
 #ifdef LINUX
+               if (cflag) {
                        tv_sub(&tcp->dtime, &ru.ru_stime, &tcp->stime);
                        tcp->stime = ru.ru_stime;
-#endif /* !LINUX */
                }
+#endif
 
                if (tcp->flags & TCB_SUSPENDED) {
                        /*
@@ -2512,12 +2512,14 @@ Process %d attached (waiting for parent)\n",
                        if (cflag != CFLAG_ONLY_STATS
                            && (qual_flags[WTERMSIG(status)] & QUAL_SIGNAL)) {
                                printleader(tcp);
+#ifdef WCOREDUMP
                                tprintf("+++ killed by %s %s+++",
                                        signame(WTERMSIG(status)),
-#ifdef WCOREDUMP
-                                       WCOREDUMP(status) ? "(core dumped) " :
+                                       WCOREDUMP(status) ? "(core dumped) " : "");
+#else
+                               tprintf("+++ killed by %s +++",
+                                       signame(WTERMSIG(status)));
 #endif
-                                       "");
                                printtrailer();
                        }
 #ifdef TCB_GROUP_EXITING