From 691206668a0bf78895d4a5fe3772f4a10c790a90 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 13 Apr 2012 19:04:38 +0200 Subject: 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. --- src/core/job.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core') 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: -- cgit v1.2.3-54-g00ecf