818
* if there are dependencies, we stay in waiting
821
job_change_state (job, job_next_state (job));
819
/* Iterate our dependencies */
820
NIH_LIST_FOREACH (&job->depends, iter) {
821
JobName *dep = (JobName *)iter;
824
/* First check the dependency is actually known; if not we
825
* still hold the job but we warn that there's a potential
828
dep_job = job_find_by_name (dep->name);
830
nih_warn (_("%s waiting for unknown dependency: %s"),
831
job->name, dep->name);
836
/* If the dependency is running with an active process,
837
* we don't need to hold for it.
839
if ((dep_job->goal == JOB_START)
840
&& (dep_job->state == JOB_RUNNING)
841
&& (dep_job->process_state == PROCESS_ACTIVE))
846
nih_info (_("%s waiting for dependency: %s"),
847
job->name, dep_job->name);
849
/* If the job isn't going to be started, try sending it
850
* a dependency event and see whether that starts it
852
if (dep_job->goal == JOB_STOP) {
855
NIH_MUST (event = event_new (NULL, "dependency"));
856
job_start_event (dep_job, event);
862
job_change_state (job, job_next_state (job));