version 1.105, 2007/11/03 11:44:30 |
version 1.106, 2007/11/03 14:05:39 |
|
|
pid_t pid; /* The child's process ID */ |
pid_t pid; /* The child's process ID */ |
GNode *node; /* The target the child is making */ |
GNode *node; /* The target the child is making */ |
short flags; /* Flags to control treatment of job */ |
short flags; /* Flags to control treatment of job */ |
#define JOB_IGNERR 0x001 /* Ignore non-zero exits */ |
|
#define JOB_SILENT 0x002 /* no output */ |
|
#define JOB_SPECIAL 0x004 /* Target is a special one. */ |
#define JOB_SPECIAL 0x004 /* Target is a special one. */ |
#define JOB_RESTART 0x080 /* Job needs to be completely restarted */ |
#define JOB_RESTART 0x080 /* Job needs to be completely restarted */ |
#define JOB_RESUME 0x100 /* Job needs to be resumed b/c it stopped, |
#define JOB_RESUME 0x100 /* Job needs to be resumed b/c it stopped, |
|
|
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
* JobFinish -- |
* JobFinish -- |
* Do final processing for the given job including updating |
* Do final processing for the given job including updating |
* parents and starting new jobs as available/necessary. Note |
* parents and starting new jobs as available/necessary. |
* that we pay no attention to the JOB_IGNERR flag here. |
|
* This is because when we're called because of a noexecute flag |
|
* or something, jstat.w_status is 0 and when called from |
|
* Job_CatchChildren, the status is zeroed if it s/b ignored. |
|
* |
* |
* Side Effects: |
* Side Effects: |
* Some nodes may be put on the toBeMade queue. |
* Some nodes may be put on the toBeMade queue. |
|
|
bool done; |
bool done; |
|
|
if ((WIFEXITED(status) && |
if ((WIFEXITED(status) && |
WEXITSTATUS(status) != 0 && !(job->flags & JOB_IGNERR)) || |
WEXITSTATUS(status) != 0 && !(job->node->type & OP_IGNORE)) || |
(WIFSIGNALED(status) && WTERMSIG(status) != SIGCONT)) { |
(WIFSIGNALED(status) && WTERMSIG(status) != SIGCONT)) { |
/* |
/* |
* If it exited non-zero and either we're doing things our |
* If it exited non-zero and either we're doing things our |
|
|
banner(job, stdout); |
banner(job, stdout); |
(void)fprintf(stdout, "*** Error code %d%s\n", |
(void)fprintf(stdout, "*** Error code %d%s\n", |
WEXITSTATUS(status), |
WEXITSTATUS(status), |
(job->flags & JOB_IGNERR) ? "(ignored)" : |
(job->node->type & OP_IGNORE) ? |
""); |
"(ignored)" : ""); |
|
|
if (job->flags & JOB_IGNERR) { |
if (job->node->type & OP_IGNORE) { |
status = 0; |
status = 0; |
} |
} |
} else if (DEBUG(JOB)) { |
} else if (DEBUG(JOB)) { |
|
|
* are also added to the field. |
* are also added to the field. |
*/ |
*/ |
job->flags = flags; |
job->flags = flags; |
if (Targ_Ignore(gn)) { |
|
job->flags |= JOB_IGNERR; |
|
} |
|
if (Targ_Silent(gn)) { |
|
job->flags |= JOB_SILENT; |
|
} |
|
|
|
/* |
/* |
* Check the commands now so any attributes from .DEFAULT have a chance |
* Check the commands now so any attributes from .DEFAULT have a chance |
|
|
* the commands, too, but don't die if they're no good -- it |
* the commands, too, but don't die if they're no good -- it |
* does no harm to keep working up the graph. |
* does no harm to keep working up the graph. |
*/ |
*/ |
Job_Touch(gn, job->flags & JOB_SILENT); |
Job_Touch(gn); |
noExec = true; |
noExec = true; |
} |
} |
|
|