summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-11-02 16:29:04 -0600
committerGitHub <noreply@github.com>2016-11-02 16:29:04 -0600
commit31887c73b998db2fe61292aa2b19a17d6cd5e494 (patch)
treef2713ccf12bfde6b35f0912923f44f43d0b75673 /src/core/unit.c
parent5b9635d16656090afa6c3aef52be469ff39fe247 (diff)
parentb09246352f751c95ab06f598b639f6f6ca0e67b1 (diff)
Merge pull request #4456 from keszybz/stored-fds
Preserve stored fds over service restart
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index cabb1050a8..8e6cef103b 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -302,6 +302,7 @@ int unit_set_description(Unit *u, const char *description) {
bool unit_check_gc(Unit *u) {
UnitActiveState state;
+ bool inactive;
assert(u);
if (u->job)
@@ -311,16 +312,17 @@ bool unit_check_gc(Unit *u) {
return true;
state = unit_active_state(u);
+ inactive = state == UNIT_INACTIVE;
/* If the unit is inactive and failed and no job is queued for
* it, then release its runtime resources */
if (UNIT_IS_INACTIVE_OR_FAILED(state) &&
UNIT_VTABLE(u)->release_resources)
- UNIT_VTABLE(u)->release_resources(u);
+ UNIT_VTABLE(u)->release_resources(u, inactive);
/* But we keep the unit object around for longer when it is
* referenced or configured to not be gc'ed */
- if (state != UNIT_INACTIVE)
+ if (!inactive)
return true;
if (u->no_gc)