summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-26 19:25:02 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-26 19:25:02 +0100
commitac1135be1f18443981211e38fc66437f147c6aee (patch)
tree86a0685ea707b3bbbc7a1335151cc45ebaebb2f6 /job.c
parentc8d9aef34f1e2867225ad9230fcdb52e8179de92 (diff)
get rid of 'linked' notion for objects
Diffstat (limited to 'job.c')
-rw-r--r--job.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/job.c b/job.c
index a2100e3318..4daed49f20 100644
--- a/job.c
+++ b/job.c
@@ -30,12 +30,12 @@ void job_free(Job *j) {
assert(j);
/* Detach from next 'bigger' objects */
- if (j->linked) {
+ if (j->installed) {
if (j->name->meta.job == j)
j->name->meta.job = NULL;
hashmap_remove(j->manager->jobs, UINT32_TO_PTR(j->id));
- j->linked = false;
+ j->installed = false;
}
/* Detach from next 'smaller' objects */
@@ -260,7 +260,7 @@ bool job_is_runnable(Job *j) {
Name *other;
assert(j);
- assert(j->linked);
+ assert(j->installed);
/* Checks whether there is any job running for the names this
* job needs to be running after (in the case of a 'positive'
@@ -308,7 +308,9 @@ bool job_is_runnable(Job *j) {
int job_run_and_invalidate(Job *j) {
int r;
+
assert(j);
+ assert(j->installed);
if (j->in_run_queue) {
LIST_REMOVE(Job, run_queue, j->manager->run_queue, j);
@@ -401,6 +403,7 @@ int job_finish_and_invalidate(Job *j, bool success) {
Iterator i;
assert(j);
+ assert(j->installed);
/* Patch restart jobs so that they become normal start jobs */
if (success && (j->type == JOB_RESTART || j->type == JOB_TRY_RESTART)) {
@@ -460,7 +463,7 @@ int job_finish_and_invalidate(Job *j, bool success) {
void job_schedule_run(Job *j) {
assert(j);
- assert(j->linked);
+ assert(j->installed);
if (j->in_run_queue)
return;