summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2012-12-14 11:10:03 +0000
committerespie <espie@openbsd.org>2012-12-14 11:10:03 +0000
commit08712ee147a79344672ab05c8205fa33c92c9883 (patch)
tree37ef9b1e621a5db3e8968d8fc200c7f9a02e4a4d
parentregen (diff)
downloadwireguard-openbsd-08712ee147a79344672ab05c8205fa33c92c9883.tar.xz
wireguard-openbsd-08712ee147a79344672ab05c8205fa33c92c9883.zip
a few more comments
-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 *);