From f8169e62dfc9ea903bc880064a5d384cdc68db3e Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Tue, 22 Aug 2017 13:54:21 +0100 Subject: [PATCH] logind: method_schedule_shutdown() already rejects empty `type` Don't test for an empty `type` afterwards. This is not how you cancel scheduled shutdowns - there's a separate method for that. --- src/login/logind-dbus.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 0f8d0205ae..3e18064e19 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -2051,12 +2051,9 @@ static int method_schedule_shutdown(sd_bus_message *message, void *userdata, sd_ if (r < 0) return r; - if (!isempty(type)) { - r = update_schedule_file(m); - if (r < 0) - return r; - } else - (void) unlink("/run/systemd/shutdown/scheduled"); + r = update_schedule_file(m); + if (r < 0) + return r; return sd_bus_reply_method_return(message, NULL); } -- 2.25.1