X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Funit.c;h=229bd0f73ad56b20a0ecc3e71f7e838d6ff7d2cb;hp=9f7ba9227b780b1f6971f9a60bed529a69500c8b;hb=9c3349e23b14db27e7ba45f82cf647899c563ea9;hpb=bbe05969ec5b8b89a20f052f63ebb3790c0c5574 diff --git a/src/core/unit.c b/src/core/unit.c index 9f7ba9227..229bd0f73 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -2674,7 +2674,9 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) { if (streq(l, "job")) { if (v[0] == '\0') { /* new-style serialized job */ - Job *j = job_new_raw(u); + Job *j; + + j = job_new_raw(u); if (!j) return -ENOMEM; @@ -2696,12 +2698,11 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) { job_free(j); return r; } - - if (j->state == JOB_RUNNING) - u->manager->n_running_jobs++; } else { /* legacy */ - JobType type = job_type_from_string(v); + JobType type; + + type = job_type_from_string(v); if (type < 0) log_debug("Failed to parse job type value %s", v); else