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.
This commit is contained in:
Alan Jenkins 2017-08-22 13:54:21 +01:00
parent cbc373502f
commit f8169e62df

View file

@ -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);
}