From: Alan Jenkins Date: Tue, 22 Aug 2017 12:54:21 +0000 (+0100) Subject: logind: method_schedule_shutdown() already rejects empty `type` X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=aaf612724cb34042a50589e842c8d577f6789f25;p=elogind.git 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. --- 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); }