From: Alan Jenkins Date: Tue, 22 Aug 2017 12:54:21 +0000 (+0100) Subject: logind: method_schedule_shutdown() already rejects empty `type` X-Git-Tag: v235~192^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f8169e62dfc9ea903bc880064a5d384cdc68db3e;p=thirdparty%2Fsystemd.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 0f8d0205ae4..3e18064e193 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); }