mirror of
https://github.com/systemd/systemd.git
synced 2024-12-03 15:23:36 +08:00
logind: fix handle_action_valid()
This commit is contained in:
parent
ba119ffcf9
commit
9fa9c66dbd
@ -21,7 +21,7 @@ typedef enum HandleAction {
|
||||
|
||||
typedef struct ActionTableItem ActionTableItem;
|
||||
|
||||
#define handle_action_valid(x) (x && (x < _HANDLE_ACTION_MAX))
|
||||
#define handle_action_valid(x) (x >= 0 && x < _HANDLE_ACTION_MAX)
|
||||
|
||||
#include "logind-inhibit.h"
|
||||
#include "logind.h"
|
||||
|
@ -84,7 +84,7 @@ static void button_lid_switch_handle_action(Manager *manager, bool is_edge) {
|
||||
* differently */
|
||||
if (manager_is_docked_or_external_displays(manager))
|
||||
handle_action = manager->handle_lid_switch_docked;
|
||||
else if (!handle_action_valid(manager->handle_lid_switch_ep) && manager_is_on_external_power())
|
||||
else if (handle_action_valid(manager->handle_lid_switch_ep) && manager_is_on_external_power())
|
||||
handle_action = manager->handle_lid_switch_ep;
|
||||
else
|
||||
handle_action = manager->handle_lid_switch;
|
||||
|
Loading…
Reference in New Issue
Block a user