summaryrefslogtreecommitdiff
path: root/src/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-05 19:49:15 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-05 19:50:00 +0200
commitf976f3f67ce5140dc0ba48e0c21a91a553905c57 (patch)
treedbb2171d6d6d8b03ef58b2a8f53f0ba59c819a3e /src/unit.c
parentd9ff321ad9477664c34b81a9dd4fce616e44124e (diff)
socket: make sockets to pass to a service configurable
Diffstat (limited to 'src/unit.c')
-rw-r--r--src/unit.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/unit.c b/src/unit.c
index 0a8ee61900..fefa0eb516 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -2190,6 +2190,23 @@ bool unit_pending_inactive(Unit *u) {
return false;
}
+bool unit_pending_active(Unit *u) {
+ assert(u);
+
+ /* Returns true if the unit is inactive or going down */
+
+ if (UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(u)))
+ return true;
+
+ if (u->meta.job &&
+ (u->meta.job->type == JOB_START ||
+ u->meta.job->type == JOB_RELOAD_OR_START ||
+ u->meta.job->type == JOB_RESTART))
+ return true;
+
+ return false;
+}
+
static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = {
[UNIT_STUB] = "stub",
[UNIT_LOADED] = "loaded",