diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-04-25 21:57:41 -0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-25 22:01:49 -0300 |
commit | 31afa0a44c2d7f93d837c840cdbd623982ac165f (patch) | |
tree | 054b8f0aa7aabfe01f02db08286793eeef8b7159 /src/core/manager.c | |
parent | 67fb4482acb0ecccb8a30e7ca49e5de28ba49eaf (diff) |
unit: rework stop pending logic
When a trigger unit wants to know if a stop is queued for it, we should
just check precisely that and do not check whether it is actually
stopped already. This is because we use these checks usually from state
change calls where the state variables are not updated yet.
This change splits unit_pending_inactive() into two calls
unit_inactive_or_pending() and unit_stop_pending(). The former checks
state and pending jobs, the latter only pending jobs.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r-- | src/core/manager.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index 2265ef7173..c7f8f20a70 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2328,7 +2328,7 @@ void manager_reset_failed(Manager *m) { unit_reset_failed(u); } -bool manager_unit_pending_inactive(Manager *m, const char *name) { +bool manager_unit_inactive_or_pending(Manager *m, const char *name) { Unit *u; assert(m); @@ -2339,7 +2339,7 @@ bool manager_unit_pending_inactive(Manager *m, const char *name) { if (!u) return true; - return unit_pending_inactive(u); + return unit_inactive_or_pending(u); } void manager_check_finished(Manager *m) { |