]> 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)
committerGuy Harris <[email protected]>
Sun, 14 Apr 2013 18:58:33 +0000 (11:58 -0700)
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 bdbfd36e80e427911e01994f186d57c349bf83ab..7f5ff6adc29e88cbbf7fcf1ca3379f692d2a45dd 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);