CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2018/03/01 19:30:15
Modified files:
sbin/shutdown : shutdown.c
Log message:
Refactor the countdown loop() to simplify it.
If we insert our offset into tlist[] and then process tlist[] like an
array we can eliminate many of the special cases and duplicate calls
in loop().
While we're at it, change struct interval and timewarn() to use time_t
to eliminate the need for some of the casting and add explicit long-long
suffixes to the constants in tlist[] to head off overflow if the code
wanders off.
With type-related input from tb@ and a style tweak from anton@.
ok tb@