summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToby Goodwin <toby@paccrat.org>2018-02-17 16:03:30 +0000
committerToby Goodwin <toby@paccrat.org>2018-02-17 16:03:30 +0000
commit67a87ad0104d88e8b1711a3831d616598edb30c2 (patch)
treeebd5d0a9cd3df379174742b00fcbff58eedd5969
parentdff49d84c0ef9880b191ebbaac2cf65a17eb481a (diff)
remove all references to SIGCLD
-rw-r--r--AUTHORS14
-rw-r--r--acinclude.m436
-rw-r--r--configure.ac2
-rw-r--r--fn.c11
-rw-r--r--signal.c10
-rw-r--r--testcld.c19
6 files changed, 14 insertions, 78 deletions
diff --git a/AUTHORS b/AUTHORS
index 696f9c6..3b425aa 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -31,10 +31,10 @@ version of rc presented here differs in some respects.
Toby would like to thank these people for their contributions since he
took over maintenance of rc. Aharon Robbins, Arvid Requate, Bengt
Kleberg, Bert Münnich, Brynjulv Hauksson, Byron Rakitzis, Callum Gibson,
-Casper Ti. Vector, Chris Siebenmann, Christian Neukirchen, Dale Scheetz,
-Dan Moniz, David Luyer, David Swasey, Decklin Foster, Donn Cave, Erik
-Quanstrom, Gary Carvell, Gerry Tomlinson, Gert-Jan Vons, Ian Lance
-Taylor, Jakub Wilk, Jeremy Fitzhardinge, Leah Neukirchen, Marc
-Moorcroft, Mark H Wilkinson, Mark K Gardner, Raymond Venneker, Rich
-$alz, Rob Savoye, Scott Schwartz, Stefan Dalibor, Steve Simon, Thomas
-Nordin, Tom Culliton, Tom Tromey, Vincent Broman, Wolfgang Zekoll.
+Casper Ti. Vector, Chris Siebenmann, Dale Scheetz, Dan Moniz, David
+Luyer, David Swasey, Decklin Foster, Donn Cave, Erik Quanstrom, Gary
+Carvell, Gerry Tomlinson, Gert-Jan Vons, Ian Lance Taylor, Jakub Wilk,
+Jeremy Fitzhardinge, Leah Neukirchen, Marc Moorcroft, Mark H Wilkinson,
+Mark K Gardner, Raymond Venneker, Rich $alz, Rob Savoye, Scott Schwartz,
+Stefan Dalibor, Steve Simon, Thomas Nordin, Tom Culliton, Tom Tromey,
+Vincent Broman, Wolfgang Zekoll.
diff --git a/acinclude.m4 b/acinclude.m4
index 3f9ec93..19d0d50 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -128,42 +128,6 @@ AC_DEFUN([RC_TYPE_SIG_ATOMIC_T], [
])
-dnl Do we have SysV SIGCLD semantics? In other words, if we set the
-dnl action for SIGCLD to SIG_IGN does wait() always say ECHILD? Linux,
-dnl of course, is bizarre here. It basically implements the SysV
-dnl semantics, but if the parent calls wait() before the child calls
-dnl exit(), wait() returns with the PID of the child as normal. (Real
-dnl SysV waits for all children to exit, then returns with ECHILD.)
-dnl Anyway, this is why the `sleep(1)' is there.
-AC_DEFUN([RC_SYS_V_SIGCLD], [
- AC_CACHE_CHECK(for SysV SIGCLD semantics, rc_cv_sysv_sigcld,
- AC_TRY_RUN([
-#include <errno.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-int main(void) {
- int i;
- signal(SIGCLD, SIG_IGN);
- switch (fork()) {
- case -1:
- return 1;
- case 0:
- return 0;
- default:
- sleep(1);
- if (wait(&i) == -1 && errno == ECHILD) return 0;
- else return 1;
- }
-}
- ], rc_cv_sysv_sigcld=yes, rc_cv_sysv_sigcld=no, rc_cv_sysv_sigcld=yes))
- case "$rc_cv_sysv_sigcld" in
- yes) AC_DEFINE(HAVE_SYSV_SIGCLD, 1, [Has SysV SIGCLD]) ;;
- esac
-])
-
-
dnl Do we have /dev/fd or /proc/self/fd?
AC_DEFUN([RC_SYS_DEV_FD], [
AC_CACHE_CHECK(for /dev/fd, rc_cv_sys_dev_fd,
diff --git a/configure.ac b/configure.ac
index 23ebf8a..c9d1cb4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,8 +63,6 @@ RC_TYPE_RLIM_T
RC_TYPE_SIG_ATOMIC_T
-RC_SYS_V_SIGCLD
-
dnl Does the kernel handle `#! /interpreter'?
AC_SYS_INTERPRETER
case "$ac_cv_sys_interpreter" in
diff --git a/fn.c b/fn.c
index 7d9e4f7..01652b4 100644
--- a/fn.c
+++ b/fn.c
@@ -29,10 +29,7 @@ extern void inithandler() {
null.type = nBody;
null.u[0].p = null.u[1].p = NULL;
for (i = 1; i < NUMOFSIGNALS; i++)
-#if HAVE_SYSV_SIGCLD
- if (i != SIGCLD)
-#endif
- if (sighandlers[i] == SIG_IGN)
+ if (i != SIGCHLD && sighandlers[i] == SIG_IGN)
fnassign(signals[i].name, NULL); /* ignore incoming ignored signals */
if (interactive || sighandlers[SIGINT] != SIG_IGN) {
def_sigint = sigint;
@@ -151,10 +148,8 @@ extern void fnassign(char *name, Node *def) {
new->def = newdef;
new->extdef = NULL;
if (strncmp(name, "sig", conststrlen("sig")) == 0) { /* slight optimization */
-#if HAVE_SYSV_SIGCLD /* System V machines treat SIGCLD very specially */
- if (streq(name, "sigcld"))
- rc_error("can't trap SIGCLD");
-#endif
+ if (streq(name, "sigchld") || streq(name, "sigcld"))
+ rc_error("can't trap SIGCHLD");
if (streq(name, "sigexit"))
runexit = TRUE;
for (i = 1; i < NUMOFSIGNALS; i++) /* zero is a bogus signal */
diff --git a/signal.c b/signal.c
index 68dcc27..aa74922 100644
--- a/signal.c
+++ b/signal.c
@@ -83,14 +83,12 @@ extern void initsignal() {
void (*h)(int);
int i;
-#if HAVE_SYSV_SIGCLD
- /* Ensure that SIGCLD is not SIG_IGN. Solaris's rshd does this. :-( */
- h = sys_signal(SIGCLD, SIG_IGN);
+ /* Ensure that SIGCHLD is not SIG_IGN. Solaris's rshd does this. :-( */
+ h = sys_signal(SIGCHLD, SIG_IGN);
if (h != SIG_IGN && h != SIG_ERR)
- sys_signal(SIGCLD, h);
+ sys_signal(SIGCHLD, h);
else
- sys_signal(SIGCLD, SIG_DFL);
-#endif
+ sys_signal(SIGCHLD, SIG_DFL);
for (i = 1; i < NUMOFSIGNALS; i++) {
#ifdef SIGKILL
diff --git a/testcld.c b/testcld.c
deleted file mode 100644
index 83212e9..0000000
--- a/testcld.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <errno.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-int main(void) {
- int i;
- sigset(SIGCLD, SIG_IGN);
- switch (fork()) {
- case -1:
- return 1;
- case 0:
- return 0;
- default:
- sleep(1);
- if (wait(&i) == -1 && errno == ECHILD) return 0;
- else return 1;
- }
-}