summaryrefslogtreecommitdiff
path: root/src/core/job.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-04-13 19:04:38 +0200
committerLennart Poettering <lennart@poettering.net>2012-04-13 19:46:51 +0200
commit691206668a0bf78895d4a5fe3772f4a10c790a90 (patch)
treecde1934f9ce86bee56764959339a0a4a988f678c /src/core/job.c
parentbb061708d5aa83579f213bdfb67253f7027217c3 (diff)
unit: signal explicitly if a condition failed in unit_start()
We shouldn't print a status message on the console if we skipped a unit due to a condition. Hence make unit_start() return -ENOEXEC in such a case which is mapped to JOB_SKIPPED which results in no console message.
Diffstat (limited to 'src/core/job.c')
-rw-r--r--src/core/job.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/job.c b/src/core/job.c
index 781f83e175..f3c76d66b5 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -417,7 +417,8 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) {
switch (result) {
case JOB_DONE:
- unit_status_printf(u, ANSI_HIGHLIGHT_GREEN_ON " OK " ANSI_HIGHLIGHT_OFF, "Started %s", unit_description(u));
+ if (u->condition_result)
+ unit_status_printf(u, ANSI_HIGHLIGHT_GREEN_ON " OK " ANSI_HIGHLIGHT_OFF, "Started %s", unit_description(u));
break;
case JOB_FAILED: