summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-17 14:09:16 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-17 20:41:52 +0100
commit7c65093ae351d82a04a3e03582e8faedee798adc (patch)
tree52df5b0758dd6554dbacb6ba0d0bfe4056827c74 /src
parent97329d201064dcfb839a66e5933623f03d87eae6 (diff)
core: make unit_make_transient() more thorough
Let's reset more stuff that does not apply to transient units. Also, let's readd the unito to all queues, because it's identity now changed.
Diffstat (limited to 'src')
-rw-r--r--src/core/unit.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 7809bfd754..db2bac3dd6 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3428,7 +3428,15 @@ int unit_make_transient(Unit *u) {
u->load_state = UNIT_STUB;
u->load_error = 0;
u->transient = true;
+
u->fragment_path = mfree(u->fragment_path);
+ u->source_path = mfree(u->source_path);
+ u->dropin_paths = strv_free(u->dropin_paths);
+ u->fragment_mtime = u->source_mtime = u->dropin_mtime = 0;
+
+ unit_add_to_dbus_queue(u);
+ unit_add_to_gc_queue(u);
+ unit_add_to_load_queue(u);
return 0;
}
@@ -3708,7 +3716,7 @@ int unit_fail_if_symlink(Unit *u, const char* where) {
bool unit_is_pristine(Unit *u) {
assert(u);
- /* Check if the unit already exists or is already referenced,
+ /* Check if the unit already exists or is already around,
* in a number of different ways. Note that to cater for unit
* types such as slice, we are generally fine with units that
* are marked UNIT_LOADED even even though nothing was
@@ -3719,8 +3727,6 @@ bool unit_is_pristine(Unit *u) {
u->fragment_path ||
u->source_path ||
!strv_isempty(u->dropin_paths) ||
- u->refs ||
- set_size(u->dependencies[UNIT_REFERENCED_BY]) > 0 ||
u->job ||
u->merged_into);
}