~upstart-devel/upstart/trunk

« back to all changes in this revision

Viewing changes to init/job.c

  • Committer: James Hunt
  • Date: 2014-09-03 16:28:24 UTC
  • mfrom: (1660.1.1 upstart-bug-1357252)
  • Revision ID: james.hunt@ubuntu.com-20140903162824-4f039oykmggh18kh
* Merge of lp:~jamesodhunt/upstart/bug-1357252.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2683
2683
                nih_assert_not_reached ();
2684
2684
        }
2685
2685
}
 
2686
 
 
2687
#ifdef ENABLE_CGROUPS
 
2688
/**
 
2689
 * job_last_process:
 
2690
 *
 
2691
 * @job: job,
 
2692
 * @process: process.
 
2693
 *
 
2694
 * Returns: TRUE if the last defined process for @job is @process,
 
2695
 *  else FALSE.
 
2696
 **/
 
2697
int
 
2698
job_last_process (const Job *job, ProcessType process)
 
2699
{
 
2700
        ProcessType  i;
 
2701
        ProcessType  last = PROCESS_INVALID;
 
2702
 
 
2703
        nih_assert (job);
 
2704
        nih_assert (process >= PROCESS_MAIN);
 
2705
        nih_assert (process < PROCESS_LAST);
 
2706
 
 
2707
        for (i = 0; i < PROCESS_LAST; i++) {
 
2708
                if (job->class->process[i])
 
2709
                        last = i;
 
2710
        }
 
2711
 
 
2712
        return last == process ? TRUE : FALSE;
 
2713
}
 
2714
#endif /* ENABLE_CGROUPS */
 
2715