]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Report *all* non-zero exit codes from the tcpdump command.
authorGuy Harris <[email protected]>
Thu, 31 Aug 2017 04:53:12 +0000 (21:53 -0700)
committerGuy Harris <[email protected]>
Thu, 31 Aug 2017 04:53:12 +0000 (21:53 -0700)
That will report, for example, exit code 139, which is issued for
SIGSEGV crashes.

tests/TESTonce

index 012364fc3db591a39a7a3f96dc41e7b6a68904dc..7026624bfe6919604e8ec758b77dde5b9dfa4a4b 100755 (executable)
@@ -22,8 +22,8 @@ else {
     # we used to do this as a nice pipeline, but the problem is that $r fails to
     # to be set properly if the tcpdump core dumps.
     $r = system "../tcpdump 2>/dev/null -n -t -r $input $options >NEW/$output";
     # we used to do this as a nice pipeline, but the problem is that $r fails to
     # to be set properly if the tcpdump core dumps.
     $r = system "../tcpdump 2>/dev/null -n -t -r $input $options >NEW/$output";
-    if($r == 0x100) {
-        # this means tcpdump exited with code 1.
+    if($r != 0) {
+        # this means tcpdump failed.
         open(OUTPUT, ">>"."NEW/$output") || die "fail to open $output\n";
         printf OUTPUT "EXIT CODE %08x\n", $r;
         close(OUTPUT);
         open(OUTPUT, ">>"."NEW/$output") || die "fail to open $output\n";
         printf OUTPUT "EXIT CODE %08x\n", $r;
         close(OUTPUT);