diff options
author | Alan Jenkins <alan.christopher.jenkins@gmail.com> | 2017-08-24 15:21:21 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-08-24 15:21:21 +0100 |
commit | cf620cb8882004665dd54904f38ca18ec5d157b0 (patch) | |
tree | 2367a5ea3cbffdff40c0623851e09beb7875ca2f /src | |
parent | 0bd783770a0b8216a99a78146f83c942e9042233 (diff) |
logind: tighten assertion in execute_shutdown_or_sleep()
Following commit b498d6ea, I belated realized we should tighten the
assertions as well, to make sure that we're setting `m->action_what` to
represent an action in progress. (The check for an action in progress is
to compare `m->action_what` to zero)
Diffstat (limited to 'src')
-rw-r--r-- | src/login/logind-dbus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 70c87e9d0..8da2eb63f 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -1532,7 +1532,7 @@ static int execute_shutdown_or_sleep( int r; assert(m); - assert(w >= 0); + assert(w > 0); assert(w < _INHIBIT_WHAT_MAX); assert(unit_name); @@ -1691,7 +1691,7 @@ int bus_manager_shutdown_or_sleep_now_or_later( assert(m); assert(unit_name); - assert(w >= 0); + assert(w > 0); assert(w <= _INHIBIT_WHAT_MAX); assert(!m->action_job); |