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:
Markus Armbruster 2008-07-20 10:28:57 -04:00
parent 797f9b121e
commit fc00db8f5d

View file

@ -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) { if (shutdown_was_pending)
pr("The shutdown time has been changed to %d minutes!", pr("The shutdown time has been changed to %d minutes!\n",
shutdown_minutes); shutdown_minutes);
} else { else
pr("The server shutdown has been cancelled!"); 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;
} }
} else if (shutdown_minutes) {
pr("Shutdown sequence begun.\n");
} }
return RET_OK; return RET_OK;
} }