diff options
author | Sven Eden <yamakuzure@gmx.net> | 2018-08-15 09:01:47 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | 95ddf8036d90ed95e4087b2a3aef3f9dc9561e1b (patch) | |
tree | e5f701e5c631f2e2cdb49bc3e9cf37c481c14481 /src/login/logind-dbus.c | |
parent | ad31ae9ed41c3d3b42f78958aa7bc9b58e877b28 (diff) |
Prep v239: Uncomment header inclusions that are new or needed now.
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r-- | src/login/logind-dbus.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index f9d0b1c9f..31acd57dc 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -2338,11 +2338,11 @@ static int method_can_shutdown_or_sleep( if (sleep_verb) { #if 0 /// elogind needs to have the manager being passed r = can_sleep(sleep_verb); - if (IN_SET(r, 0, -ENOSPC)) - return sd_bus_reply_method_return(message, "s", "na"); #else r = can_sleep(m, sleep_verb); #endif // 0 + if (IN_SET(r, 0, -ENOSPC)) + return sd_bus_reply_method_return(message, "s", "na"); if (r < 0) return r; } @@ -2385,6 +2385,10 @@ static int method_can_shutdown_or_sleep( } #endif // 0 } +#else + if ( (handle <= HANDLE_IGNORE) || (handle >= _HANDLE_ACTION_MAX) ) { + result = "no"; + goto finish; } if (multiple_sessions) { @@ -2430,6 +2434,7 @@ static int method_can_shutdown_or_sleep( } finish: + return sd_bus_reply_method_return(message, "s", result); } |