diff options
Diffstat (limited to 'src/shutdown')
-rw-r--r-- | src/shutdown/hpr.h | 2 | ||||
-rw-r--r-- | src/shutdown/hpr_shutdown.c | 2 | ||||
-rw-r--r-- | src/shutdown/s6-linux-init-hpr.c | 2 | ||||
-rw-r--r-- | src/shutdown/s6-linux-init-shutdown.c | 16 | ||||
-rw-r--r-- | src/shutdown/s6-linux-init-shutdownd.c | 14 |
5 files changed, 18 insertions, 18 deletions
diff --git a/src/shutdown/hpr.h b/src/shutdown/hpr.h index 2c545a5..fd268e8 100644 --- a/src/shutdown/hpr.h +++ b/src/shutdown/hpr.h @@ -17,7 +17,7 @@ #define hpr_send(s, n) openwritenclose_unsafe(INITCTL, (s), n) #define hpr_cancel() hpr_send("c", 1) -extern int hpr_shutdown (unsigned int, tain_t const *, unsigned int) ; +extern int hpr_shutdown (unsigned int, tain const *, unsigned int) ; extern void hpr_wall (char const *) ; extern void hpr_wallv (struct iovec const *, unsigned int) ; extern void hpr_confirm_hostname (void) ; diff --git a/src/shutdown/hpr_shutdown.c b/src/shutdown/hpr_shutdown.c index 3ede92d..c5e98b1 100644 --- a/src/shutdown/hpr_shutdown.c +++ b/src/shutdown/hpr_shutdown.c @@ -7,7 +7,7 @@ #include "hpr.h" -int hpr_shutdown (unsigned int what, tain_t const *when, unsigned int grace) +int hpr_shutdown (unsigned int what, tain const *when, unsigned int grace) { char pack[5 + TAIN_PACK] = { "Shpr"[what] } ; tain_pack(pack+1, when) ; diff --git a/src/shutdown/s6-linux-init-hpr.c b/src/shutdown/s6-linux-init-hpr.c index a874ac3..fe8a77d 100644 --- a/src/shutdown/s6-linux-init-hpr.c +++ b/src/shutdown/s6-linux-init-hpr.c @@ -46,7 +46,7 @@ int main (int argc, char const *const *argv) PROG = "s6-linux-init-hpr" ; { - subgetopt_t l = SUBGETOPT_ZERO ; + subgetopt l = SUBGETOPT_ZERO ; for (;;) { int opt = subgetopt_r(argc, argv, "hprfdwWni", &l) ; diff --git a/src/shutdown/s6-linux-init-shutdown.c b/src/shutdown/s6-linux-init-shutdown.c index ce7f01f..2e81c3b 100644 --- a/src/shutdown/s6-linux-init-shutdown.c +++ b/src/shutdown/s6-linux-init-shutdown.c @@ -49,9 +49,9 @@ static inline void add_one_day (struct tm *tm) tm->tm_year++ ; } -static inline void parse_hourmin (tain_t *when, char const *s) +static inline void parse_hourmin (tain *when, char const *s) { - tai_t taithen ; + tai taithen ; struct tm tmthen ; unsigned int hour, minute ; size_t len = uint_scan(s, &hour) ; @@ -67,25 +67,25 @@ static inline void parse_hourmin (tain_t *when, char const *s) tmthen.tm_min = minute ; tmthen.tm_sec = 0 ; if (!tai_from_localtm(&taithen, &tmthen)) - strerr_diefu1sys(111, "assemble broken-down time into tain_t") ; + strerr_diefu1sys(111, "assemble broken-down time into tain") ; if (tai_less(&taithen, tain_secp(&STAMP))) { add_one_day(&tmthen) ; if (!tai_from_localtm(&taithen, &tmthen)) - strerr_diefu1sys(111, "assemble broken-down time into tain_t") ; + strerr_diefu1sys(111, "assemble broken-down time into tain") ; } when->sec = taithen ; when->nano = 0 ; } -static void parse_mins (tain_t *when, char const *s) +static void parse_mins (tain *when, char const *s) { unsigned int mins ; if (!uint0_scan(s, &mins)) dieusage() ; tain_addsec_g(when, mins * 60) ; } -static inline void parse_time (tain_t *when, char const *s) +static inline void parse_time (tain *when, char const *s) { if (!strcmp(s, "now")) tain_copynow(when) ; else if (s[0] == '+') parse_mins(when, s+1) ; @@ -257,11 +257,11 @@ int main (int argc, char const *const *argv) int doactl = 0 ; int docancel = 0 ; int doconfirm = 0 ; - tain_t when ; + tain when ; PROG = "s6-linux-init-shutdown" ; { - subgetopt_t l = SUBGETOPT_ZERO ; + subgetopt l = SUBGETOPT_ZERO ; for (;;) { int opt = subgetopt_r(argc, argv, "HPhprkafFcit:", &l) ; diff --git a/src/shutdown/s6-linux-init-shutdownd.c b/src/shutdown/s6-linux-init-shutdownd.c index 16e0780..e448b92 100644 --- a/src/shutdown/s6-linux-init-shutdownd.c +++ b/src/shutdown/s6-linux-init-shutdownd.c @@ -100,7 +100,7 @@ static inline void run_stage3 (char const *basedir) else strerr_warnwu2sys("spawn ", stage3) ; } -static inline void prepare_shutdown (buffer *b, tain_t *deadline, unsigned int *grace_time) +static inline void prepare_shutdown (buffer *b, tain *deadline, unsigned int *grace_time) { uint32_t u ; char pack[TAIN_PACK + 4] ; @@ -113,7 +113,7 @@ static inline void prepare_shutdown (buffer *b, tain_t *deadline, unsigned int * if (u && u <= 300000) *grace_time = u ; } -static inline void handle_fifo (buffer *b, char *what, tain_t *deadline, unsigned int *grace_time) +static inline void handle_fifo (buffer *b, char *what, tain *deadline, unsigned int *grace_time) { for (;;) { @@ -255,7 +255,7 @@ static inline void unsupervise_tree (void) int main (int argc, char const *const *argv) { unsigned int grace_time = 3000 ; - tain_t deadline ; + tain deadline ; int fdr, fdw ; buffer b ; char what = 'S' ; @@ -263,7 +263,7 @@ int main (int argc, char const *const *argv) PROG = "s6-linux-init-shutdownd" ; { - subgetopt_t l = SUBGETOPT_ZERO ; + subgetopt l = SUBGETOPT_ZERO ; for (;;) { int opt = subgetopt_r(argc, argv, "c:g:CB", &l) ; @@ -312,8 +312,8 @@ int main (int argc, char const *const *argv) fdw = open_write(SHUTDOWND_FIFO) ; if (fdw == -1 || coe(fdw) == -1) strerr_diefu3sys(111, "open ", SHUTDOWND_FIFO, " for writing") ; - if (sig_ignore(SIGPIPE) == -1) - strerr_diefu1sys(111, "sig_ignore SIGPIPE") ; + if (!sig_altignore(SIGPIPE)) + strerr_diefu1sys(111, "ignore SIGPIPE") ; buffer_init(&b, &buffer_read, fdr, buf, 64) ; tain_now_set_stopwatch_g() ; tain_add_g(&deadline, &tain_infinite_relative) ; @@ -344,7 +344,7 @@ int main (int argc, char const *const *argv) prepare_stage4(basedir, what) ; unsupervise_tree() ; - if (sig_ignore(SIGTERM) == -1) strerr_warnwu1sys("sig_ignore SIGTERM") ; + if (!sig_ignore(SIGTERM)) strerr_warnwu1sys("ignore SIGTERM") ; if (!inns) { sync() ; |