summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2003-12-13 15:26:27 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2003-12-13 15:26:27 +0000
commit43584314059a57a7e78ee5f7d53b2c7f4f420e7e (patch)
treee10ab937f631188daba940e2887f4c0a8b20e3d9
parentfc2ada1918a131fd58aac52ea10c63b565f22e5d (diff)
Notes
-rw-r--r--usr.bin/make/main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 9fccf969df2d..497eb779e3a0 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -410,6 +410,10 @@ chdir_verify_path(char *path, char *obpath)
return 0;
}
+void
+catch_child(int sig)
+{
+}
/*-
* main --
@@ -452,6 +456,22 @@ main(int argc, char **argv)
/* avoid faults on read-only strings */
static char syspath[] = _PATH_DEFSYSPATH;
+ {
+ /*
+ * Catch SIGCHLD so that we get kicked out of select() when we
+ * need to look at a child. This is only known to matter for the
+ * -j case (perhaps without -P).
+ *
+ * XXX this is intentionally misplaced.
+ */
+ struct sigaction sa;
+
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_RESTART | SA_NOCLDSTOP;
+ sa.sa_handler = catch_child;
+ sigaction(SIGCHLD, &sa, NULL);
+ }
+
#ifdef WANT_ENV_MKLVL
if ((iMkLvl = szMkLvl ? atoi(szMkLvl) : 0) < 0) {
iMkLvl = 0;