summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'job.c')
-rw-r--r--job.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/job.c b/job.c
index feaa3a63029d..b6a0ab334a6f 100644
--- a/job.c
+++ b/job.c
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.198 2020/06/19 21:17:48 sjg Exp $ */
+/* $NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.198 2020/06/19 21:17:48 sjg Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: job.c,v 1.198 2020/06/19 21:17:48 sjg Exp $");
+__RCSID("$NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -274,7 +274,7 @@ static Shell shells[] = {
"",
},
/*
- * KSH description.
+ * KSH description.
*/
{
"ksh",
@@ -447,7 +447,7 @@ JobCreatePipe(Job *job, int minfd)
job->jobPipe[i] = fd;
}
}
-
+
/* Set close-on-exec flag for both */
if (fcntl(job->jobPipe[0], F_SETFD, FD_CLOEXEC) == -1)
Punt("Cannot set close-on-exec: %s", strerror(errno));
@@ -457,7 +457,7 @@ JobCreatePipe(Job *job, int minfd)
/*
* We mark the input side of the pipe non-blocking; we poll(2) the
* pipe when we're waiting for a job token, but we might lose the
- * race for the token when a new one becomes available, so the read
+ * race for the token when a new one becomes available, so the read
* from the pipe should not block.
*/
flags = fcntl(job->jobPipe[0], F_GETFL, 0);
@@ -780,7 +780,7 @@ JobPrintCommand(void *cmdp, void *jobp)
/*
* If the shell doesn't have error control the alternate echo'ing will
- * be done (to avoid showing additional error checking code)
+ * be done (to avoid showing additional error checking code)
* and this will need the characters '$ ` \ "' escaped
*/
@@ -788,10 +788,10 @@ JobPrintCommand(void *cmdp, void *jobp)
/* Worst that could happen is every char needs escaping. */
escCmd = bmake_malloc((strlen(cmd) * 2) + 1);
for (i = 0, j= 0; cmd[i] != '\0'; i++, j++) {
- if (cmd[i] == '$' || cmd[i] == '`' || cmd[i] == '\\' ||
+ if (cmd[i] == '$' || cmd[i] == '`' || cmd[i] == '\\' ||
cmd[i] == '"')
escCmd[j++] = '\\';
- escCmd[j] = cmd[i];
+ escCmd[j] = cmd[i];
}
escCmd[j] = 0;
}
@@ -864,13 +864,13 @@ JobPrintCommand(void *cmdp, void *jobp)
}
} else {
- /*
+ /*
* If errors are being checked and the shell doesn't have error control
* but does supply an errOut template, then setup commands to run
* through it.
*/
- if (!commandShell->hasErrCtl && commandShell->errOut &&
+ if (!commandShell->hasErrCtl && commandShell->errOut &&
(*commandShell->errOut != '\0')) {
if (!(job->flags & JOB_SILENT) && !shutUp) {
if (commandShell->hasEchoCtl) {
@@ -894,7 +894,7 @@ JobPrintCommand(void *cmdp, void *jobp)
DBPRINTF("set -%s\n", "x");
job->flags |= JOB_TRACED;
}
-
+
DBPRINTF(cmdTemplate, cmd);
free(cmdStart);
free(escCmd);
@@ -935,7 +935,7 @@ JobSaveCommand(void *cmd, void *gn)
{
cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, VARF_WANTRES);
(void)Lst_AtEnd(postCommands->commands, cmd);
- return(0);
+ return 0;
}
@@ -1102,7 +1102,7 @@ JobFinish (Job *job, WAIT_T status)
}
}
#endif
-
+
return_job_token = FALSE;
Trace_Log(JOBEND, job);
@@ -1274,7 +1274,7 @@ Job_CheckCommands(GNode *gn, void (*abortProc)(const char *, ...))
* .DEFAULT itself.
*/
Make_HandleUse(DEFAULT, gn);
- Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), gn, 0);
+ Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), gn);
free(p1);
} else if (Dir_MTime(gn, 0) == 0 && (gn->type & OP_SPECIAL) == 0) {
/*
@@ -1419,7 +1419,7 @@ JobExec(Job *job, char **argv)
_exit(1);
}
}
-
+
/*
* Set up the child's output to be routed through the pipe
* we've created for it.
@@ -1768,7 +1768,7 @@ JobStart(GNode *gn, int flags)
JobCreatePipe(job, 3);
JobExec(job, argv);
- return(JOB_RUNNING);
+ return JOB_RUNNING;
}
static char *
@@ -2260,11 +2260,11 @@ Shell_GetNewline(void)
void
Job_SetPrefix(void)
{
-
+
if (targPrefix) {
free(targPrefix);
} else if (!Var_Exists(MAKE_JOB_PREFIX, VAR_GLOBAL)) {
- Var_Set(MAKE_JOB_PREFIX, "---", VAR_GLOBAL, 0);
+ Var_Set(MAKE_JOB_PREFIX, "---", VAR_GLOBAL);
}
targPrefix = Var_Subst(NULL, "${" MAKE_JOB_PREFIX "}",
@@ -2410,7 +2410,7 @@ JobMatchShell(const char *name)
for (sh = shells; sh->name != NULL; sh++) {
if (strcmp(name, sh->name) == 0)
- return (sh);
+ return sh;
}
return NULL;
}
@@ -2526,7 +2526,7 @@ Job_ParseShell(char *line)
Parse_Error(PARSE_FATAL, "Unknown keyword \"%s\"",
*argv);
free(words);
- return(FAILURE);
+ return FAILURE;
}
fullSpec = TRUE;
}
@@ -2542,13 +2542,13 @@ Job_ParseShell(char *line)
if (newShell.name == NULL) {
Parse_Error(PARSE_FATAL, "Neither path nor name specified");
free(words);
- return(FAILURE);
+ return FAILURE;
} else {
if ((sh = JobMatchShell(newShell.name)) == NULL) {
Parse_Error(PARSE_WARNING, "%s: No matching shell",
newShell.name);
free(words);
- return(FAILURE);
+ return FAILURE;
}
commandShell = sh;
shellName = newShell.name;
@@ -2584,7 +2584,7 @@ Job_ParseShell(char *line)
Parse_Error(PARSE_WARNING, "%s: No matching shell",
shellName);
free(words);
- return(FAILURE);
+ return FAILURE;
}
commandShell = sh;
} else {
@@ -2701,7 +2701,7 @@ Job_Finish(void)
JobRun(postCommands);
}
}
- return(errors);
+ return errors;
}
/*-
@@ -2940,7 +2940,7 @@ Job_ServerStart(int max_tokens, int jp_0, int jp_1)
{
int i;
char jobarg[64];
-
+
if (jp_0 >= 0 && jp_1 >= 0) {
/* Pipe passed in from parent */
tokenWaitJob.inPipe = jp_0;
@@ -2956,12 +2956,12 @@ Job_ServerStart(int max_tokens, int jp_0, int jp_1)
tokenWaitJob.inPipe, tokenWaitJob.outPipe);
Var_Append(MAKEFLAGS, "-J", VAR_GLOBAL);
- Var_Append(MAKEFLAGS, jobarg, VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, jobarg, VAR_GLOBAL);
/*
* Preload the job pipe with one token per job, save the one
* "extra" token for the primary job.
- *
+ *
* XXX should clip maxJobs against PIPE_BUF -- if max_tokens is
* larger than the write buffer size of the pipe, we will
* deadlock here.
@@ -3078,7 +3078,7 @@ Job_RunTarget(const char *target, const char *fname) {
return FALSE;
if (fname)
- Var_Set(ALLSRC, fname, gn, 0);
+ Var_Set(ALLSRC, fname, gn);
JobRun(gn);
if (gn->made == ERROR) {
@@ -3113,9 +3113,9 @@ emul_poll(struct pollfd *fd, int nfd, int timeout)
if (fd[i].fd > maxfd)
maxfd = fd[i].fd;
}
-
+
if (maxfd >= FD_SETSIZE) {
- Punt("Ran out of fd_set slots; "
+ Punt("Ran out of fd_set slots; "
"recompile with a larger FD_SETSIZE.");
}