X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fjob.c;h=85f77e8f0d8335959cbb26a23648f2bf237313b2;hp=9a425a6da1cdaf28e2ac5dd4f4852e6027be3fec;hb=c2756a68401102786be343712c0c35acbd73d28d;hpb=3ecaa09bccd8a59c9f1e06756a1334a162206dc4 diff --git a/src/core/job.c b/src/core/job.c index 9a425a6da..85f77e8f0 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -569,7 +569,7 @@ int job_run_and_invalidate(Job *j) { return r; } -static const char *job_get_status_message_format(Unit *u, JobType t, JobResult result) { +_pure_ static const char *job_get_status_message_format(Unit *u, JobType t, JobResult result) { const UnitStatusMessageFormats *format_table; assert(u); @@ -588,7 +588,7 @@ static const char *job_get_status_message_format(Unit *u, JobType t, JobResult r return NULL; } -static const char *job_get_status_message_format_try_harder(Unit *u, JobType t, JobResult result) { +_pure_ static const char *job_get_status_message_format_try_harder(Unit *u, JobType t, JobResult result) { const char *format; assert(u); @@ -1088,10 +1088,13 @@ void job_shutdown_magic(Job *j) { * asynchronous sync() would cause their exit to be * delayed. */ - if (!unit_has_name(j->unit, SPECIAL_SHUTDOWN_TARGET)) + if (j->type != JOB_START) return; - if (j->type != JOB_START) + if (j->unit->manager->running_as != SYSTEMD_SYSTEM) + return; + + if (!unit_has_name(j->unit, SPECIAL_SHUTDOWN_TARGET)) return; if (detect_container(NULL) > 0)