version 1.17, 1999/12/18 02:11:26 |
version 1.18, 1999/12/18 21:53:32 |
|
|
* the parents. In addition, any saved commands for the node are placed |
* the parents. In addition, any saved commands for the node are placed |
* on the .END target. |
* on the .END target. |
*/ |
*/ |
if (job->tailCmds != NILLNODE) { |
if (job->tailCmds != NULL) { |
Lst_ForEachFrom(job->node->commands, job->tailCmds, |
Lst_ForEachFrom(job->node->commands, job->tailCmds, |
JobSaveCommand, |
JobSaveCommand, |
(ClientData)job->node); |
(ClientData)job->node); |
|
|
* No commands. Look for .DEFAULT rule from which we might infer |
* No commands. Look for .DEFAULT rule from which we might infer |
* commands |
* commands |
*/ |
*/ |
if ((DEFAULT != NILGNODE) && !Lst_IsEmpty(DEFAULT->commands)) { |
if ((DEFAULT != NULL) && !Lst_IsEmpty(DEFAULT->commands)) { |
/* |
/* |
* Make only looks for a .DEFAULT if the node was never the |
* Make only looks for a .DEFAULT if the node was never the |
* target of an operator, so that's what we do too. If |
* target of an operator, so that's what we do too. If |
|
|
} |
} |
|
|
job->node = gn; |
job->node = gn; |
job->tailCmds = NILLNODE; |
job->tailCmds = NULL; |
|
|
/* |
/* |
* Set the initial value of the flags for this job based on the global |
* Set the initial value of the flags for this job based on the global |
|
|
} else { |
} else { |
LstNode ln = Lst_Next(gn->commands); |
LstNode ln = Lst_Next(gn->commands); |
|
|
if ((ln == NILLNODE) || |
if ((ln == NULL) || |
JobPrintCommand((ClientData) Lst_Datum(ln), |
JobPrintCommand((ClientData) Lst_Datum(ln), |
(ClientData) job)) |
(ClientData) job)) |
{ |
{ |
|
|
*/ |
*/ |
if (cmdsOK) { |
if (cmdsOK) { |
if (aborting == 0) { |
if (aborting == 0) { |
if (job->tailCmds != NILLNODE) { |
if (job->tailCmds != NULL) { |
Lst_ForEachFrom(job->node->commands, job->tailCmds, |
Lst_ForEachFrom(job->node->commands, job->tailCmds, |
JobSaveCommand, |
JobSaveCommand, |
(ClientData)job->node); |
(ClientData)job->node); |
|
|
|
|
jnode = Lst_Find(jobs, (ClientData)&pid, JobCmpPid); |
jnode = Lst_Find(jobs, (ClientData)&pid, JobCmpPid); |
|
|
if (jnode == NILLNODE) { |
if (jnode == NULL) { |
if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) { |
if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) { |
jnode = Lst_Find(stoppedJobs, (ClientData) &pid, JobCmpPid); |
jnode = Lst_Find(stoppedJobs, (ClientData) &pid, JobCmpPid); |
if (jnode == NILLNODE) { |
if (jnode == NULL) { |
Error("Resumed child (%d) not in table", pid); |
Error("Resumed child (%d) not in table", pid); |
continue; |
continue; |
} |
} |
|
|
free(readfdsp); |
free(readfdsp); |
Punt("Cannot open job table"); |
Punt("Cannot open job table"); |
} |
} |
while (nfds && (ln = Lst_Next(jobs)) != NILLNODE) { |
while (nfds && (ln = Lst_Next(jobs)) != NULL) { |
job = (Job *) Lst_Datum(ln); |
job = (Job *) Lst_Datum(ln); |
if (FD_ISSET(job->inPipe, readfdsp)) { |
if (FD_ISSET(job->inPipe, readfdsp)) { |
JobDoOutput(job, FALSE); |
JobDoOutput(job, FALSE); |
|
|
aborting = 0; |
aborting = 0; |
errors = 0; |
errors = 0; |
|
|
lastNode = NILGNODE; |
lastNode = NULL; |
|
|
if (maxJobs == 1 |
if (maxJobs == 1 |
#ifdef REMOTE |
#ifdef REMOTE |
|
|
|
|
begin = Targ_FindNode(".BEGIN", TARG_NOCREATE); |
begin = Targ_FindNode(".BEGIN", TARG_NOCREATE); |
|
|
if (begin != NILGNODE) { |
if (begin != NULL) { |
JobStart(begin, JOB_SPECIAL, (Job *)0); |
JobStart(begin, JOB_SPECIAL, (Job *)0); |
while (nJobs) { |
while (nJobs) { |
Job_CatchOutput(); |
Job_CatchOutput(); |
|
|
aborting = ABORT_INTERRUPT; |
aborting = ABORT_INTERRUPT; |
|
|
(void) Lst_Open(jobs); |
(void) Lst_Open(jobs); |
while ((ln = Lst_Next(jobs)) != NILLNODE) { |
while ((ln = Lst_Next(jobs)) != NULL) { |
job = (Job *) Lst_Datum(ln); |
job = (Job *) Lst_Datum(ln); |
|
|
if (!Targ_Precious(job->node)) { |
if (!Targ_Precious(job->node)) { |
|
|
|
|
#ifdef REMOTE |
#ifdef REMOTE |
(void)Lst_Open(stoppedJobs); |
(void)Lst_Open(stoppedJobs); |
while ((ln = Lst_Next(stoppedJobs)) != NILLNODE) { |
while ((ln = Lst_Next(stoppedJobs)) != NULL) { |
job = (Job *) Lst_Datum(ln); |
job = (Job *) Lst_Datum(ln); |
|
|
if (job->flags & JOB_RESTART) { |
if (job->flags & JOB_RESTART) { |
|
|
|
|
if (runINTERRUPT && !touchFlag) { |
if (runINTERRUPT && !touchFlag) { |
interrupt = Targ_FindNode(".INTERRUPT", TARG_NOCREATE); |
interrupt = Targ_FindNode(".INTERRUPT", TARG_NOCREATE); |
if (interrupt != NILGNODE) { |
if (interrupt != NULL) { |
ignoreErrors = FALSE; |
ignoreErrors = FALSE; |
|
|
JobStart(interrupt, JOB_IGNDOTS, (Job *)0); |
JobStart(interrupt, JOB_IGNDOTS, (Job *)0); |
|
|
int |
int |
Job_Finish() |
Job_Finish() |
{ |
{ |
if (postCommands != NILGNODE && !Lst_IsEmpty(postCommands->commands)) { |
if (postCommands != NULL && !Lst_IsEmpty(postCommands->commands)) { |
if (errors) { |
if (errors) { |
Error("Errors reported so .END ignored"); |
Error("Errors reported so .END ignored"); |
} else { |
} else { |
|
|
if (nJobs) { |
if (nJobs) { |
|
|
(void) Lst_Open(jobs); |
(void) Lst_Open(jobs); |
while ((ln = Lst_Next(jobs)) != NILLNODE) { |
while ((ln = Lst_Next(jobs)) != NULL) { |
job = (Job *) Lst_Datum(ln); |
job = (Job *) Lst_Datum(ln); |
|
|
/* |
/* |
|
|
} |
} |
jnode = Lst_Find(jobs, (ClientData)hostID, JobCmpRmtID); |
jnode = Lst_Find(jobs, (ClientData)hostID, JobCmpRmtID); |
|
|
if (jnode == NILLNODE) { |
if (jnode == NULL) { |
jnode = Lst_Find(stoppedJobs, (ClientData)hostID, JobCmpRmtID); |
jnode = Lst_Find(stoppedJobs, (ClientData)hostID, JobCmpRmtID); |
if (jnode == NILLNODE) { |
if (jnode == NULL) { |
if (DEBUG(JOB)) { |
if (DEBUG(JOB)) { |
Error("Evicting host(%d) not in table", hostID); |
Error("Evicting host(%d) not in table", hostID); |
} |
} |