From b518e0266198443fcc8a4bf66be4e3642dc38405 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 4 Aug 2019 05:42:53 +0900 Subject: [PATCH 1/2] login: drop space in empty line --- src/login/logind-button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/login/logind-button.c b/src/login/logind-button.c index 86c9121f27..5598fb2c0b 100644 --- a/src/login/logind-button.c +++ b/src/login/logind-button.c @@ -339,7 +339,7 @@ int button_open(Button *b) { return log_error_errno(errno, "Failed to get input name for %s: %m", p); (void) button_set_mask(b->name, fd); - + b->io_event_source = sd_event_source_unref(b->io_event_source); r = sd_event_add_io(b->manager->event, &b->io_event_source, fd, EPOLLIN, button_dispatch, b); if (r < 0) From 18f689b1fa35c53580da62bfce875fb15d20d448 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 4 Aug 2019 05:43:34 +0900 Subject: [PATCH 2/2] Revert "logind: remove unused check" This reverts commit f2330acda408a34451d5e15380fcdd225a672473. Fixes #13255. --- src/login/logind-action.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/login/logind-action.c b/src/login/logind-action.c index fa92f4870a..140953eec1 100644 --- a/src/login/logind-action.c +++ b/src/login/logind-action.c @@ -61,8 +61,12 @@ int manager_handle_action( int r; assert(m); - /* We should be called only with valid actions different than HANDLE_IGNORE. */ - assert(handle > HANDLE_IGNORE && handle < _HANDLE_ACTION_MAX); + + /* If the key handling is turned off, don't do anything */ + if (handle == HANDLE_IGNORE) { + log_debug("Refusing operation, as it is turned off."); + return 0; + } if (inhibit_key == INHIBIT_HANDLE_LID_SWITCH) { /* If the last system suspend or startup is too close,