]> The Tcpdump Group git mirrors - tcpdump/commitdiff
If we get SIGCHLD, restart whatever system call it interrupted.
authorAlexandra Kossovsky <[email protected]>
Sun, 14 Apr 2013 18:57:56 +0000 (11:57 -0700)
committerMichael Richardson <[email protected]>
Sun, 14 Apr 2013 22:20:26 +0000 (18:20 -0400)
When compressing output with -z, we do so by creating a child process to
run gzip and pipe to it, and we catch SIGCHLD to clean up after the
child process.  We don't want the SIGCHLD to show up as an "Interrupted
system call" error, so we specify that SIGCHLD should restart, rather
than interrupting, system calls.

CREDITS
setsignal.c

diff --git a/CREDITS b/CREDITS
index 135b1785bb9d5471a58fbb5b02245c434e9e7f8d..a1065593d5321392dbc21b99592e0c6c47e41fd3 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -14,6 +14,7 @@ Additional people who have contributed patches:
     Aaron Campbell                <aaron at arbor dot net>
     Alfredo Andres                <aandres at s21sec dot com>
     Albert Chin                   <china at thewrittenword dot com>
+    Alexandra Kossovsky           <alexandra1975 at sourceforge dot net>
     Ananth Suryanarayana          <anantha at juniper dot net>
     Andrea Bittau                 <a dot bittau at cs dot ucl dot ac dot uk>
     Andrew Brown                  <atatat at atatdot dot net>
index a4b59cefe1bb562200e8a70af0caa1a723308fb9..6032835e578875a35abdac7450df376d107b5c8d 100644 (file)
@@ -78,6 +78,8 @@ RETSIGTYPE
 
        memset(&new, 0, sizeof(new));
        new.sa_handler = func;
+       if (sig == SIGCHLD)
+               new.sa_flags = SA_RESTART;
        if (sigaction(sig, &new, &old) < 0)
                return (SIG_ERR);
        return (old.sa_handler);