version 1.114, 2008/11/04 07:22:35 |
version 1.115, 2008/11/11 09:32:20 |
|
|
static Job * |
static Job * |
prepare_job(GNode *gn, int flags) |
prepare_job(GNode *gn, int flags) |
{ |
{ |
Job *job; /* new job descriptor */ |
|
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 */ |
|
|
job = emalloc(sizeof(Job)); |
|
if (job == NULL) { |
|
Punt("JobStart out of memory"); |
|
} |
|
|
|
job->node = gn; |
|
|
|
/* |
/* |
* Set the initial value of the flags for this job based on the global |
|
* ones and the node's attributes... Any flags supplied by the caller |
|
* are also added to the field. |
|
*/ |
|
job->flags = flags; |
|
|
|
/* |
|
* Check the commands now so any attributes from .DEFAULT have a chance |
* Check the commands now so any attributes from .DEFAULT have a chance |
* to migrate to the node |
* to migrate to the node |
*/ |
*/ |
|
|
* We only want to work our way up the graph if we aren't here |
* We only want to work our way up the graph if we aren't here |
* because the commands for the job were no good. |
* because the commands for the job were no good. |
*/ |
*/ |
if (cmdsOK) { |
if (cmdsOK && !aborting) { |
if (aborting == 0) { |
gn->built_status = MADE; |
job->node->built_status = MADE; |
Make_Update(gn); |
Make_Update(job->node); |
|
} |
|
} |
} |
free(job); |
|
return NULL; |
return NULL; |
} else { |
} else { |
|
Job *job; /* new job descriptor */ |
|
job = emalloc(sizeof(Job)); |
|
if (job == NULL) |
|
Punt("JobStart out of memory"); |
|
|
|
job->node = gn; |
|
|
|
/* |
|
* Set the initial value of the flags for this job based on the |
|
* global ones and the node's attributes... Any flags supplied |
|
* by the caller are also added to the field. |
|
*/ |
|
job->flags = flags; |
|
|
return job; |
return job; |
} |
} |
} |
} |