From 02da852383cf2aac72b3ad77e69799a44adb97e8 Mon Sep 17 00:00:00 2001 From: Alexandra Kossovsky Date: Sun, 14 Apr 2013 11:57:56 -0700 Subject: [PATCH] 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. --- CREDITS | 1 + setsignal.c | 2 ++ 2 files changed, 3 insertions(+) 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); -- 2.39.5