chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unit: fix false positive in check for unneeded unit
[elogind.git]
/
src
/
unit.c
diff --git
a/src/unit.c
b/src/unit.c
index 2a549e2f81186133bc3c6e288197613a4da61968..56137d7bd14c60ae423c80884d0cb48a5dd536aa 100644
(file)
--- a/
src/unit.c
+++ b/
src/unit.c
@@
-858,6
+858,7
@@
fail:
u->meta.load_state = UNIT_ERROR;
u->meta.load_error = r;
unit_add_to_dbus_queue(u);
u->meta.load_state = UNIT_ERROR;
u->meta.load_error = r;
unit_add_to_dbus_queue(u);
+ unit_add_to_gc_queue(u);
log_debug("Failed to load configuration for %s: %s", u->meta.id, strerror(-r));
log_debug("Failed to load configuration for %s: %s", u->meta.id, strerror(-r));
@@
-1031,19
+1032,19
@@
static void unit_check_unneeded(Unit *u) {
return;
SET_FOREACH(other, u->meta.dependencies[UNIT_REQUIRED_BY], i)
return;
SET_FOREACH(other, u->meta.dependencies[UNIT_REQUIRED_BY], i)
- if (
!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)
))
+ if (
unit_pending_active(other
))
return;
SET_FOREACH(other, u->meta.dependencies[UNIT_REQUIRED_BY_OVERRIDABLE], i)
return;
SET_FOREACH(other, u->meta.dependencies[UNIT_REQUIRED_BY_OVERRIDABLE], i)
- if (
!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)
))
+ if (
unit_pending_active(other
))
return;
SET_FOREACH(other, u->meta.dependencies[UNIT_WANTED_BY], i)
return;
SET_FOREACH(other, u->meta.dependencies[UNIT_WANTED_BY], i)
- if (
!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)
))
+ if (
unit_pending_active(other
))
return;
SET_FOREACH(other, u->meta.dependencies[UNIT_BOUND_BY], i)
return;
SET_FOREACH(other, u->meta.dependencies[UNIT_BOUND_BY], i)
- if (
!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)
))
+ if (
unit_pending_active(other
))
return;
log_info("Service %s is not needed anymore. Stopping.", u->meta.id);
return;
log_info("Service %s is not needed anymore. Stopping.", u->meta.id);
@@
-2517,7
+2518,7
@@
bool unit_pending_inactive(Unit *u) {
bool unit_pending_active(Unit *u) {
assert(u);
bool unit_pending_active(Unit *u) {
assert(u);
- /* Returns true if the unit is
inactive or going down
*/
+ /* Returns true if the unit is
active or going up
*/
if (UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(u)))
return true;
if (UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(u)))
return true;