From: Alexandra Kossovsky Date: Sun, 14 Apr 2013 18:57:56 +0000 (-0700) Subject: If we get SIGCHLD, restart whatever system call it interrupted. X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/a0624450e3a9ce59c8c2f83cbe3d576631370944 If we get SIGCHLD, restart whatever system call it interrupted. 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. --- diff --git a/CREDITS b/CREDITS index bdbfd36e..7f5ff6ad 100644 --- a/CREDITS +++ b/CREDITS @@ -14,6 +14,7 @@ Additional people who have contributed patches: Aaron Campbell Alfredo Andres Albert Chin + Alexandra Kossovsky Ananth Suryanarayana Andrea Bittau Andrew Brown diff --git a/setsignal.c b/setsignal.c index a4b59cef..6032835e 100644 --- a/setsignal.c +++ b/setsignal.c @@ -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);