X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Ftransaction.c;h=27efef7cc68124d38990efeb941d9b7b466c42c8;hb=3731acf1acfb4a6eb68374a5b137f3b368f63381;hp=4a8d90e6e569692c14f5890eae89ad69033a0cc3;hpb=37d3ab1b7e114f0fb6dfb2e7273569b42794b76a;p=elogind.git diff --git a/src/core/transaction.c b/src/core/transaction.c index 4a8d90e6e..27efef7cc 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -24,6 +24,7 @@ #include "transaction.h" #include "bus-errors.h" +#include "dbus-common.h" static void transaction_unlink_job(Transaction *tr, Job *j, bool delete_dependencies); @@ -139,7 +140,7 @@ static void transaction_merge_and_delete_job(Transaction *tr, Job *j, Job *other transaction_delete_job(tr, other, true); } -static bool job_is_conflicted_by(Job *j) { +_pure_ static bool job_is_conflicted_by(Job *j) { JobDependency *l; assert(j); @@ -319,7 +320,7 @@ rescan: } } -static bool unit_matters_to_anchor(Unit *u, Job *j) { +_pure_ static bool unit_matters_to_anchor(Unit *u, Job *j) { assert(u); assert(!j->transaction_prev); @@ -732,8 +733,11 @@ int transaction_activate(Transaction *tr, Manager *m, JobMode mode, DBusError *e * feature for cosmetics, not actually useful for * anything beyond that. */ - if (m->idle_pipe[0] < 0 && m->idle_pipe[1] < 0) + if (m->idle_pipe[0] < 0 && m->idle_pipe[1] < 0 && + m->idle_pipe[2] < 0 && m->idle_pipe[3] < 0) { pipe2(m->idle_pipe, O_NONBLOCK|O_CLOEXEC); + pipe2(m->idle_pipe + 2, O_NONBLOCK|O_CLOEXEC); + } } return 0; @@ -850,12 +854,13 @@ int transaction_add_job_and_dependencies( if (unit->load_state != UNIT_LOADED && unit->load_state != UNIT_ERROR && + unit->load_state != UNIT_NOT_FOUND && unit->load_state != UNIT_MASKED) { dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s is not loaded properly.", unit->id); return -EINVAL; } - if (type != JOB_STOP && unit->load_state == UNIT_ERROR) { + if (type != JOB_STOP && (unit->load_state == UNIT_ERROR || unit->load_state == UNIT_NOT_FOUND)) { dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s failed to load: %s. " "See system logs and 'systemctl status %s' for details.",