summaryrefslogtreecommitdiff
path: root/usr.bin/make/job.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-06-10 01:32:24 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-06-10 01:32:24 +0000
commit902d39cd46468c0b8155dcef6b36cbca21d39ef4 (patch)
treecfabd80ee6dbc8f45687ba6fe88bb5d092930a7b /usr.bin/make/job.c
parent180f58f247b5d42362ff6fe4a356db32d22d8d27 (diff)
Thus, Lst_ForEach no longer needs returning a status.
In fact, it can become a macro based on Lst_ForEachFrom. This also introduces Lst_Every, as a shortcut for the very common case where Lst_ForEach does not need any user data. Finally, make consistent use of a few function typedefs, instead of having explicit void (*)(Lst) arguments all over the place.
Diffstat (limited to 'usr.bin/make/job.c')
-rw-r--r--usr.bin/make/job.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index 9a75dda2acd..29aa6c952cd 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: job.c,v 1.26 2000/06/10 01:26:36 espie Exp $ */
+/* $OpenBSD: job.c,v 1.27 2000/06/10 01:32:22 espie Exp $ */
/* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: job.c,v 1.26 2000/06/10 01:26:36 espie Exp $";
+static char rcsid[] = "$OpenBSD: job.c,v 1.27 2000/06/10 01:32:22 espie Exp $";
#endif
#endif /* not lint */
@@ -292,11 +292,11 @@ STATIC Lst stoppedJobs; /* Lst of Job structures describing
#define W_SETEXITSTATUS(st, val) W_SETMASKED(st, val, WEXITSTATUS)
-static int JobCondPassSig __P((ClientData, ClientData));
+static void JobCondPassSig __P((ClientData, ClientData));
static void JobPassSig __P((int));
static int JobCmpPid __P((ClientData, ClientData));
static int JobPrintCommand __P((ClientData, ClientData));
-static int JobSaveCommand __P((ClientData, ClientData));
+static void JobSaveCommand __P((ClientData, ClientData));
static void JobClose __P((Job *));
#ifdef REMOTE
static int JobCmpRmtID __P((Job *, ClientData));
@@ -322,15 +322,12 @@ static void JobRestartJobs __P((void));
* Pass a signal to a job if the job is remote or if USE_PGRP
* is defined.
*
- * Results:
- * === 0
- *
* Side Effects:
* None, except the job may bite it.
*
*-----------------------------------------------------------------------
*/
-static int
+static void
JobCondPassSig(jobp, signop)
ClientData jobp; /* Job to biff */
ClientData signop; /* Signal to send it */
@@ -356,7 +353,6 @@ JobCondPassSig(jobp, signop)
}
KILL(job->pid, signo);
#endif
- return 0;
}
/*-
@@ -663,22 +659,18 @@ JobPrintCommand(cmdp, jobp)
* Save a command to be executed when everything else is done.
* Callback function for JobFinish...
*
- * Results:
- * Always returns 0
- *
* Side Effects:
* The command is tacked onto the end of postCommands's commands list.
*
*-----------------------------------------------------------------------
*/
-static int
+static void
JobSaveCommand(cmd, gn)
ClientData cmd;
ClientData gn;
{
cmd = (ClientData) Var_Subst((char *) cmd, (GNode *) gn, FALSE);
Lst_AtEnd(postCommands->commands, cmd);
- return(0);
}
@@ -965,11 +957,7 @@ JobFinish(job, status)
* the parents. In addition, any saved commands for the node are placed
* on the .END target.
*/
- if (job->tailCmds != NULL) {
- Lst_ForEachFrom(job->node->commands, job->tailCmds,
- JobSaveCommand,
- job->node);
- }
+ Lst_ForEachFrom(job->tailCmds, JobSaveCommand, job->node);
job->node->made = MADE;
Make_Update(job->node);
free((Address)job);
@@ -1850,11 +1838,7 @@ JobStart(gn, flags, previous)
*/
if (cmdsOK) {
if (aborting == 0) {
- if (job->tailCmds != NULL) {
- Lst_ForEachFrom(job->node->commands, job->tailCmds,
- JobSaveCommand,
- job->node);
- }
+ Lst_ForEachFrom(job->tailCmds, JobSaveCommand, job->node);
Make_Update(job->node);
}
free((Address)job);