From 735a8b6d38a7116975a4650b0967ad71a4757559 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 31 Jul 2019 09:44:28 +0200 Subject: job: fix coverity issue Fixes coverity issue 1403550 --- src/core/job.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/job.c b/src/core/job.c index cda4f344b8..9537366eb9 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -1153,8 +1153,11 @@ void job_add_to_run_queue(Job *j) { log_warning_errno(r, "Failed to enable job run queue event source, ignoring: %m"); } - prioq_put(j->manager->run_queue, j, &j->run_queue_idx); - j->in_run_queue = true; + r = prioq_put(j->manager->run_queue, j, &j->run_queue_idx); + if (r < 0) + log_warning_errno(r, "Failed put job in run queue, ignoring: %m"); + else + j->in_run_queue = true; } void job_add_to_dbus_queue(Job *j) { -- cgit v1.2.3