From 8e20e31a65ec9e637abf3821087946e9160001ac Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 24 Feb 2011 03:24:51 +0100 Subject: [PATCH] systemctl: properly handle job results --- src/systemctl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/systemctl.c b/src/systemctl.c index 82741bc6..b33a89f6 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -1248,11 +1248,19 @@ static int wait_for_jobs(DBusConnection *bus, Set *s) { log_error("Job canceled."); else if (streq(d.result, "dependency")) log_error("A dependency job failed. See system logs for details."); - else + else if (!streq(d.result, "done")) log_error("Job failed. See system logs and 'systemctl status' for details."); } - r = d.result ? -EIO : 0; + if (streq_ptr(d.result, "timeout")) + r = -ETIME; + else if (streq_ptr(d.result, "canceled")) + r = -ECANCELED; + else if (!streq_ptr(d.result, "done")) + r = -EIO; + else + r = 0; + free(d.result); finish: -- 2.39.5