Make shutdown command fail when there's no shutdown to cancel
Before, it printed "Shutdown sequence begun", which was bogus.
This commit is contained in:
parent
797f9b121e
commit
fc00db8f5d
1 changed files with 11 additions and 7 deletions
|
@ -64,15 +64,19 @@ shut(void)
|
||||||
if (shutdown_was_pending < 0)
|
if (shutdown_was_pending < 0)
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
|
|
||||||
if (shutdown_was_pending) {
|
|
||||||
if (shutdown_minutes >= 0) {
|
if (shutdown_minutes >= 0) {
|
||||||
pr("The shutdown time has been changed to %d minutes!",
|
if (shutdown_was_pending)
|
||||||
|
pr("The shutdown time has been changed to %d minutes!\n",
|
||||||
shutdown_minutes);
|
shutdown_minutes);
|
||||||
} else {
|
else
|
||||||
pr("The server shutdown has been cancelled!");
|
|
||||||
}
|
|
||||||
} else if (shutdown_minutes) {
|
|
||||||
pr("Shutdown sequence begun.\n");
|
pr("Shutdown sequence begun.\n");
|
||||||
|
} else {
|
||||||
|
if (shutdown_was_pending)
|
||||||
|
pr("The server shutdown has been cancelled!\n");
|
||||||
|
else {
|
||||||
|
pr("No shutdown to abort\n");
|
||||||
|
return RET_FAIL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue