chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core: rework counting of running jobs
[elogind.git]
/
src
/
core
/
unit.c
diff --git
a/src/core/unit.c
b/src/core/unit.c
index 9f7ba9227b780b1f6971f9a60bed529a69500c8b..229bd0f73ad56b20a0ecc3e71f7e838d6ff7d2cb 100644
(file)
--- 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 */
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;
if (!j)
return -ENOMEM;
@@
-2696,12
+2698,11
@@
int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
job_free(j);
return r;
}
job_free(j);
return r;
}
-
- if (j->state == JOB_RUNNING)
- u->manager->n_running_jobs++;
} else {
/* legacy */
} 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
if (type < 0)
log_debug("Failed to parse job type value %s", v);
else