summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-12-08 08:48:34 +0000
committerPádraig Brady <P@draigBrady.com>2009-12-08 15:29:27 +0000
commitf5a97b8269f11f63cf05cca1f31a08dc7567aeb9 (patch)
tree068974c268ee16418d1b08dc98e1db4e4f4daeab /src
parent73d46261344d5bd05c0940bc2ec5f9ed9a47db1b (diff)
downloadcoreutils-f5a97b8269f11f63cf05cca1f31a08dc7567aeb9.tar.xz
sort: fix failure if sort's parent has ignored SIGCHLD
* src/sort.c (main): Reset the SIGCHLD handler to the default as otherwise wait() could return an error. * tests/misc/sort-compress: Set the CHLD handler in a subshell to SIG_IGN to ensure the sort command resets it to SIG_DFL. * NEWS: Mention the fix.
Diffstat (limited to 'src')
-rw-r--r--src/sort.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sort.c b/src/sort.c
index 8709e5370..70e0bbbae 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -3254,6 +3254,7 @@ main (int argc, char **argv)
}
#endif
}
+ signal (SIGCHLD, SIG_DFL); /* Don't inherit CHLD handling from parent. */
/* The signal mask is known, so it is safe to invoke exit_cleanup. */
atexit (exit_cleanup);