mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
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:
parent
cbc373502f
commit
f8169e62df
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user