summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-12-14 11:10:04 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-12-14 11:10:04 +0000
commitbd78886291ebe34364f1ddc09052cb5004c07646 (patch)
tree745492cb33be711705300739558a9a82180d2687 /usr.bin
parent72be6ca55f9ee97b537a93bebf6edb427398100d (diff)
a few more comments
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/job.c9
-rw-r--r--usr.bin/make/job.h13
2 files changed, 19 insertions, 3 deletions
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index d60f04b9fe8..ea3a3f7b960 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: job.c,v 1.134 2012/12/08 12:54:17 espie Exp $ */
+/* $OpenBSD: job.c,v 1.135 2012/12/14 11:10:03 espie Exp $ */
/* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */
/*
@@ -414,7 +414,7 @@ notice_signal(int sig)
}
}
-void
+static void
setup_all_signals(void)
{
sigemptyset(&sigset);
@@ -849,6 +849,11 @@ handle_running_jobs(void)
* reception of new stuff on sigsuspend
*/
sigprocmask(SIG_BLOCK, &sigset, &old);
+ /* note this will NOT loop until runningJobs == NULL.
+ * It's merely an optimisation, namely that we don't need to go
+ * through the logic if no job is present. As soon as a job
+ * gets reaped, we WILL exit the loop through the break.
+ */
while (runningJobs != NULL) {
/* did we already have pending stuff that advances things ?
* then handle_all_signals() will not return
diff --git a/usr.bin/make/job.h b/usr.bin/make/job.h
index 4ddfca413ee..e8152d18fd0 100644
--- a/usr.bin/make/job.h
+++ b/usr.bin/make/job.h
@@ -1,7 +1,7 @@
#ifndef _JOB_H_
#define _JOB_H_
-/* $OpenBSD: job.h,v 1.30 2012/12/08 12:54:17 espie Exp $ */
+/* $OpenBSD: job.h,v 1.31 2012/12/14 11:10:03 espie Exp $ */
/* $NetBSD: job.h,v 1.5 1996/11/06 17:59:10 christos Exp $ */
/*
@@ -78,7 +78,18 @@ extern void Job_Begin(void);
extern void Job_Wait(void);
extern void Job_AbortAll(void);
extern void print_errors(void);
+
+/* handle_running_jobs();
+ * wait until something happens, like a job finishing running a command
+ * or a signal coming in.
+ */
extern void handle_running_jobs(void);
+
+/* handle_all_signals();
+ * if a signal was received, react accordingly.
+ * By displaying STATUS info, or by aborting running jobs for a fatal
+ * signals. Relies on Job_Init() for setting up handlers.
+ */
extern void handle_all_signals(void);
extern void determine_expensive_job(Job *);