~vorlon/ubuntu/raring/upstart/lp.1199778

Viewing all changes in revision 843.

  • Committer: Scott James Remnant
  • Date: 2008-03-01 17:58:15 UTC
  • Revision ID: scott@netsplit.com-20080301175815-9ghzdfpn913uivtl
* init/job.c (job_new): Increment the number of instances.
(job_instance): Simplify the function, it now only returns the
existing instance or NULL.  This makes it easier to extend when
we have env-limited instances later on.
(job_handle_event): If job_instance returns NULL, create
a new instance with job_new() and always reset the operator afterwards.
* init/tests/test_job.c (test_new): Check that the instances variable
is incremented when a new job is created.
(test_instance): Change to check that it returns NULL when there is
no active instance, or for multi-instance jobs, instead of creating
a new one itself.
(test_config_replace, test_find_by_pid)
(test_find_by_id, test_change_goal, test_change_state)
(test_next_state, test_run_process, test_kill_process)
(test_child_handler, test_handle_event)
(test_handle_event_finished): Call job_new to create a new instance
from a config, instead of job_instance.

* init/tests/test_conf.c (test_source_reload_job_dir)
(test_file_destroy): Call job_new to create a new instance from a
config, instead of job_instance.
* init/tests/test_event.c (test_poll): Call job_new to create a new
instance from a config, instead of job_instance.
* init/tests/test_process.c (test_spawn, test_environment): Call
job_new to create a new instance from a config, instead of job_instance

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: