aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal KoutnĂ˝ <mkoutny@suse.com>2018-06-22 16:19:52 +0200
committerMike Gilbert <floppym@gentoo.org>2018-06-27 14:13:32 -0400
commit7769d116768052de9a8f5f13abfefa4fc3fcf759 (patch)
tree1cd3a30318f2bb8550eaa3463eadb24b27191c31
parentboot: do not assume the last character in cmdline is a newline (diff)
downloadsystemd-7769d116768052de9a8f5f13abfefa4fc3fcf759.tar.gz
systemd-7769d116768052de9a8f5f13abfefa4fc3fcf759.tar.bz2
systemd-7769d116768052de9a8f5f13abfefa4fc3fcf759.zip
core/manager: Make sure jobs statistics are not double after daemon-reload
We add n_installed_jobs and n_failed_jobs to our inner state after deserialization. This is fine during daemon-reexec when we start with clear Manager (and some jobs possibly queued before deserialization), however, daemon-reload works with the same manager and adding the values would effectively double the counters. Reset the counters before we deserialize and add their values again. (cherry picked from commit 1e75824cb005f7fa0089792e45c2747c4d059601)
-rw-r--r--src/core/manager.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 930df4e23..a3ae48115 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1234,6 +1234,8 @@ static void manager_clear_jobs_and_units(Manager *m) {
m->n_on_console = 0;
m->n_running_jobs = 0;
+ m->n_installed_jobs = 0;
+ m->n_failed_jobs = 0;
}
Manager* manager_free(Manager *m) {