summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-02-24 03:24:51 +0100
committerLennart Poettering <lennart@poettering.net>2011-02-24 03:24:51 +0100
commit8e20e31a65ec9e637abf3821087946e9160001ac (patch)
treeead17dc31f7c4d661e670b9265fff992e287cde2 /src
parentc0daa706d329d6cc593949b7d150d4972289ba93 (diff)
systemctl: properly handle job results
Diffstat (limited to 'src')
-rw-r--r--src/systemctl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 82741bc6e7..b33a89f63d 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: