summaryrefslogtreecommitdiff
path: root/src/shutdown/s6-linux-init-shutdownd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shutdown/s6-linux-init-shutdownd.c')
-rw-r--r--src/shutdown/s6-linux-init-shutdownd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shutdown/s6-linux-init-shutdownd.c b/src/shutdown/s6-linux-init-shutdownd.c
index 9707ade..f5c436c 100644
--- a/src/shutdown/s6-linux-init-shutdownd.c
+++ b/src/shutdown/s6-linux-init-shutdownd.c
@@ -103,6 +103,7 @@ static inline void prepare_shutdown (buffer *b, tain_t *deadline, unsigned int *
if (r == -1) strerr_diefu1sys(111, "read from pipe") ;
if (r < TAIN_PACK + 4) strerr_dief1x(101, "bad shutdown protocol") ;
tain_unpack(pack, deadline) ;
+ tain_add_g(deadline, deadline) ;
uint32_unpack_big(pack + TAIN_PACK, &u) ;
if (u && u <= 300000) *grace_time = u ;
}
@@ -262,7 +263,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (sig_ignore(SIGPIPE) == -1)
strerr_diefu1sys(111, "sig_ignore SIGPIPE") ;
buffer_init(&b, &buffer_read, fdr, buf, 64) ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &tain_infinite_relative) ;
for (;;)
@@ -300,6 +301,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
kill(-1, SIGTERM) ;
kill(-1, SIGCONT) ;
tain_from_millisecs(&deadline, grace_time) ;
+ tain_now_g() ;
tain_add_g(&deadline, &deadline) ;
deepsleepuntil_g(&deadline) ;
sync() ;