openrc-shutdown: fix need_warning dead store
It's already initialised to false at the start and it's clear when reading what the flow is. While at it, fix some indentation and adjust whitespace to make more readable.
This commit is contained in:
parent
a689fdb7be
commit
3bb5450320
@ -304,7 +304,6 @@ int main(int argc, char **argv)
|
|||||||
sigaction(SIGINT, &sa, NULL);
|
sigaction(SIGINT, &sa, NULL);
|
||||||
sigaction(SIGTERM, &sa, NULL);
|
sigaction(SIGTERM, &sa, NULL);
|
||||||
while (shutdown_delay > 0) {
|
while (shutdown_delay > 0) {
|
||||||
need_warning = false;
|
|
||||||
if (shutdown_delay > 180)
|
if (shutdown_delay > 180)
|
||||||
need_warning = (shutdown_delay % 60 == 0);
|
need_warning = (shutdown_delay % 60 == 0);
|
||||||
else if (shutdown_delay > 60)
|
else if (shutdown_delay > 60)
|
||||||
@ -313,6 +312,7 @@ int main(int argc, char **argv)
|
|||||||
need_warning = (shutdown_delay % 15 == 0);
|
need_warning = (shutdown_delay % 15 == 0);
|
||||||
else
|
else
|
||||||
need_warning = true;
|
need_warning = true;
|
||||||
|
|
||||||
if (shutdown_delay <= 5)
|
if (shutdown_delay <= 5)
|
||||||
create_nologin(shutdown_delay);
|
create_nologin(shutdown_delay);
|
||||||
if (need_warning) {
|
if (need_warning) {
|
||||||
|
Loading…
Reference in New Issue
Block a user