From 31afa0a44c2d7f93d837c840cdbd623982ac165f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 25 Apr 2013 21:57:41 -0300 Subject: 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. --- src/core/manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/manager.h') diff --git a/src/core/manager.h b/src/core/manager.h index 649a8aac51..a0be2927f7 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -291,7 +291,7 @@ void manager_reset_failed(Manager *m); void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success); void manager_send_unit_plymouth(Manager *m, Unit *u); -bool manager_unit_pending_inactive(Manager *m, const char *name); +bool manager_unit_inactive_or_pending(Manager *m, const char *name); void manager_check_finished(Manager *m); -- cgit v1.2.3-54-g00ecf