From f8c34706f51f5c66d33d6265b4d939d22cf90154 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 13 Nov 2018 19:40:02 +0100 Subject: [PATCH] job: add log message when we can't enable the job run event source --- src/core/job.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/job.c b/src/core/job.c index 6c4bd928a78..1a4781dc8c2 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -1036,14 +1036,19 @@ int job_start_timer(Job *j, bool job_running) { } void job_add_to_run_queue(Job *j) { + int r; + assert(j); assert(j->installed); if (j->in_run_queue) return; - if (!j->manager->run_queue) - sd_event_source_set_enabled(j->manager->run_queue_event_source, SD_EVENT_ONESHOT); + if (!j->manager->run_queue) { + r = sd_event_source_set_enabled(j->manager->run_queue_event_source, SD_EVENT_ONESHOT); + if (r < 0) + log_warning_errno(r, "Failed to enable job run queue event source, ignoring: %m"); + } LIST_PREPEND(run_queue, j->manager->run_queue, j); j->in_run_queue = true;