summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-11-16 15:45:02 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2015-11-16 16:15:42 +0100
commit2f157acdae14962ed7b7f7734f3e3547477aea0a (patch)
tree4929b3fb2b83a149426880c6b2f611159c02b674 /src/login
parent79ee4ad108adc55c44891dc0058568d1068f311e (diff)
login: ignore JobRemoved of old jobs
If we requeue jobs, we are no longer interested in old jobs. Hence, we better ignore any JobRemoved signals for old jobs and concentrate on our replacements.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/logind-dbus.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index e36217c5b2..e507a19aef 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -2620,11 +2620,8 @@ int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *err
}
session = hashmap_get(m->session_units, unit);
- if (session) {
-
- if (streq_ptr(path, session->scope_job))
- session->scope_job = mfree(session->scope_job);
-
+ if (session && streq_ptr(path, session->scope_job)) {
+ session->scope_job = mfree(session->scope_job);
session_jobs_reply(session, unit, result);
session_save(session);
@@ -2633,7 +2630,9 @@ int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *err
}
user = hashmap_get(m->user_units, unit);
- if (user) {
+ if (user &&
+ (streq_ptr(path, user->service_job) ||
+ streq_ptr(path, user->slice_job))) {
if (streq_ptr(path, user->service_job))
user->service_job = mfree(user->service_job);