version 1.29, 2000/06/17 14:38:15 |
version 1.30, 2000/06/23 16:15:49 |
|
|
* per shell. |
* per shell. |
*/ |
*/ |
if (compatMake) { |
if (compatMake) { |
|
LstNode ln; |
/* |
/* |
* Be compatible: If this is the first time for this node, |
* Be compatible: If this is the first time for this node, |
* verify its commands are ok and open the commands list for |
* verify its commands are ok and open the commands list for |
|
|
* and print it to the command file. If the command was an |
* and print it to the command file. If the command was an |
* ellipsis, note that there's nothing more to execute. |
* ellipsis, note that there's nothing more to execute. |
*/ |
*/ |
if ((job->flags&JOB_FIRST) && (Lst_Open(&gn->commands) != SUCCESS)){ |
if ((job->flags&JOB_FIRST)) |
cmdsOK = FALSE; |
Lst_Open(&gn->commands); |
} else { |
ln = Lst_Next(&gn->commands); |
LstNode ln = Lst_Next(&gn->commands); |
|
|
|
if ((ln == NULL) || !JobPrintCommand(Lst_Datum(ln), job)) { |
if ((ln == NULL) || !JobPrintCommand(Lst_Datum(ln), job)) { |
noExec = TRUE; |
noExec = TRUE; |
Lst_Close(&gn->commands); |
Lst_Close(&gn->commands); |
} |
|
if (noExec && !(job->flags & JOB_FIRST)) { |
|
/* |
|
* If we're not going to execute anything, the job |
|
* is done and we need to close down the various |
|
* file descriptors we've opened for output, then |
|
* call JobDoOutput to catch the final characters or |
|
* send the file to the screen... Note that the i/o streams |
|
* are only open if this isn't the first job. |
|
* Note also that this could not be done in |
|
* Job_CatchChildren b/c it wasn't clear if there were |
|
* more commands to execute or not... |
|
*/ |
|
JobClose(job); |
|
} |
|
} |
} |
|
if (noExec && !(job->flags & JOB_FIRST)) { |
|
/* |
|
* If we're not going to execute anything, the job |
|
* is done and we need to close down the various |
|
* file descriptors we've opened for output, then |
|
* call JobDoOutput to catch the final characters or |
|
* send the file to the screen... Note that the i/o streams |
|
* are only open if this isn't the first job. |
|
* Note also that this could not be done in |
|
* Job_CatchChildren b/c it wasn't clear if there were |
|
* more commands to execute or not... |
|
*/ |
|
JobClose(job); |
|
} |
} else { |
} else { |
/* |
/* |
* We can do all the commands at once. hooray for sanity |
* We can do all the commands at once. hooray for sanity |
|
|
continue; |
continue; |
} |
} |
} else { |
} else { |
job = (Job *) Lst_Datum(jnode); |
job = (Job *)Lst_Datum(jnode); |
Lst_Remove(&jobs, jnode); |
Lst_Remove(&jobs, jnode); |
nJobs -= 1; |
nJobs -= 1; |
if (jobFull && DEBUG(JOB)) { |
if (jobFull && DEBUG(JOB)) { |
|
|
free(readfdsp); |
free(readfdsp); |
return; |
return; |
} else { |
} else { |
if (Lst_Open(&jobs) == FAILURE) { |
Lst_Open(&jobs); |
free(readfdsp); |
|
Punt("Cannot open job table"); |
|
} |
|
while (nfds && (ln = Lst_Next(&jobs)) != NULL) { |
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); |
nfds -= 1; |
nfds -= 1; |
|
|
|
|
aborting = ABORT_INTERRUPT; |
aborting = ABORT_INTERRUPT; |
|
|
(void) Lst_Open(&jobs); |
Lst_Open(&jobs); |
while ((ln = Lst_Next(&jobs)) != NULL) { |
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)) { |
char *file = (job->node->path == NULL ? |
char *file = (job->node->path == NULL ? |
|
|
} |
} |
|
|
#ifdef REMOTE |
#ifdef REMOTE |
(void)Lst_Open(&stoppedJobs); |
Lst_Open(&stoppedJobs); |
while ((ln = Lst_Next(&stoppedJobs)) != NULL) { |
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 (DEBUG(JOB)) { |
if (DEBUG(JOB)) { |
|
|
|
|
if (nJobs) { |
if (nJobs) { |
|
|
(void) Lst_Open(&jobs); |
Lst_Open(&jobs); |
while ((ln = Lst_Next(&jobs)) != NULL) { |
while ((ln = Lst_Next(&jobs)) != NULL) { |
job = (Job *) Lst_Datum(ln); |
job = (Job *)Lst_Datum(ln); |
|
|
/* |
/* |
* kill the child process with increasingly drastic signals to make |
* kill the child process with increasingly drastic signals to make |
|
|
return; |
return; |
} |
} |
} |
} |
job = (Job *) Lst_Datum(jnode); |
job = (Job *)Lst_Datum(jnode); |
|
|
if (DEBUG(JOB)) { |
if (DEBUG(JOB)) { |
(void) fprintf(stdout, |
(void) fprintf(stdout, |