X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fjob.c;h=0b6d321e991b74aafcad7b7a6110624777636e51;hp=ac3bb9d72962c53655c3b671ea828b1febe7a49f;hb=7d1316aa29ea6757336e434a8b07266f7f2dc67a;hpb=b0c918b97f1abb160d8df2b94deb03efcb4fcf8f diff --git a/src/job.c b/src/job.c index ac3bb9d72..0b6d321e9 100644 --- a/src/job.c +++ b/src/job.c @@ -478,14 +478,18 @@ int job_finish_and_invalidate(Job *j, bool success) { return 0; } + j->failed = !success; + log_debug("Job %s/%s finished, success=%s", j->unit->meta.id, job_type_to_string(j->type), yes_no(success)); - j->failed = !success; + if (j->failed) + j->manager->n_failed_jobs ++; + u = j->unit; t = j->type; job_free(j); - if (!success) + if (!success && j->type == JOB_START) unit_status_printf(u, "Starting %s " ANSI_HIGHLIGHT_ON "failed" ANSI_HIGHLIGHT_OFF ".\n", unit_description(u)); /* Fail depending jobs on failure */