version 1.85, 2007/09/23 12:49:04 |
version 1.86, 2007/09/23 12:51:59 |
|
|
static void JobExec(Job *, char **); |
static void JobExec(Job *, char **); |
static void JobMakeArgv(Job *, char **); |
static void JobMakeArgv(Job *, char **); |
static void JobRestart(Job *); |
static void JobRestart(Job *); |
static int JobStart(GNode *, int, Job *); |
static int JobStart(GNode *, int); |
static char *JobOutput(Job *, char *, char *, int); |
static char *JobOutput(Job *, char *, char *, int); |
static void JobDoOutput(Job *, bool); |
static void JobDoOutput(Job *, bool); |
static void JobInterrupt(int, int); |
static void JobInterrupt(int, int); |
|
|
*/ |
*/ |
static int |
static int |
JobStart(GNode *gn, /* target to create */ |
JobStart(GNode *gn, /* target to create */ |
int flags, /* flags for the job to override normal ones. |
int flags) /* flags for the job to override normal ones. |
* e.g. JOB_SPECIAL or JOB_IGNDOTS */ |
* e.g. JOB_SPECIAL */ |
Job *previous) /* The previous Job structure for this node, |
|
* if any. */ |
|
{ |
{ |
Job *job; /* new job descriptor */ |
Job *job; /* new job descriptor */ |
char *argv[4]; /* Argument vector to shell */ |
char *argv[4]; /* Argument vector to shell */ |
bool cmdsOK; /* true if the nodes commands were all right */ |
bool cmdsOK; /* true if the nodes commands were all right */ |
bool noExec; /* Set true if we decide not to run the job */ |
bool noExec; /* Set true if we decide not to run the job */ |
|
|
if (previous != NULL) { |
job = emalloc(sizeof(Job)); |
previous->flags &= ~(JOB_FIRST|JOB_IGNERR|JOB_SILENT); |
if (job == NULL) { |
job = previous; |
Punt("JobStart out of memory"); |
} else { |
|
job = emalloc(sizeof(Job)); |
|
if (job == NULL) { |
|
Punt("JobStart out of memory"); |
|
} |
|
flags |= JOB_FIRST; |
|
} |
} |
|
flags |= JOB_FIRST; |
|
|
job->node = gn; |
job->node = gn; |
job->tailCmds = NULL; |
job->tailCmds = NULL; |
|
|
void |
void |
Job_Make(GNode *gn) |
Job_Make(GNode *gn) |
{ |
{ |
(void)JobStart(gn, 0, NULL); |
(void)JobStart(gn, 0); |
} |
} |
|
|
/*- |
/*- |
|
|
#endif |
#endif |
|
|
if ((begin_node->type & OP_DUMMY) == 0) { |
if ((begin_node->type & OP_DUMMY) == 0) { |
JobStart(begin_node, JOB_SPECIAL, (Job *)0); |
JobStart(begin_node, JOB_SPECIAL); |
while (nJobs) { |
while (nJobs) { |
Job_CatchOutput(); |
Job_CatchOutput(); |
Job_CatchChildren(); |
Job_CatchChildren(); |
|
|
if ((interrupt_node->type & OP_DUMMY) == 0) { |
if ((interrupt_node->type & OP_DUMMY) == 0) { |
ignoreErrors = false; |
ignoreErrors = false; |
|
|
JobStart(interrupt_node, JOB_IGNDOTS, (Job *)0); |
JobStart(interrupt_node, JOB_IGNDOTS); |
while (nJobs) { |
while (nJobs) { |
Job_CatchOutput(); |
Job_CatchOutput(); |
Job_CatchChildren(); |
Job_CatchChildren(); |
|
|
if (errors) { |
if (errors) { |
Error("Errors reported so .END ignored"); |
Error("Errors reported so .END ignored"); |
} else { |
} else { |
JobStart(end_node, JOB_SPECIAL | JOB_IGNDOTS, NULL); |
JobStart(end_node, JOB_SPECIAL | JOB_IGNDOTS); |
|
|
while (nJobs) { |
while (nJobs) { |
Job_CatchOutput(); |
Job_CatchOutput(); |