From aaf612724cb34042a50589e842c8d577f6789f25 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 0abf4d50e..d5a6a21a6 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -2100,12 +2100,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.30.2