summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-04-28 18:52:17 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-04-28 18:52:17 +0000
commit03116e4e6ae398ef0835ce83d04cbff8a27aa3aa (patch)
treeba965aacfb15b0045e634de5795f4a88f826ae2a /src
parent1c31b92725f8c121bed55d2f7446d6c7e7f7824e (diff)
downloads6-linux-init-03116e4e6ae398ef0835ce83d04cbff8a27aa3aa.tar.xz
Fix pipe reading in shutdown
Diffstat (limited to 'src')
-rw-r--r--src/shutdown/s6-linux-init-shutdownd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shutdown/s6-linux-init-shutdownd.c b/src/shutdown/s6-linux-init-shutdownd.c
index c01727d..2cb9215 100644
--- a/src/shutdown/s6-linux-init-shutdownd.c
+++ b/src/shutdown/s6-linux-init-shutdownd.c
@@ -71,11 +71,11 @@ static inline void run_stage3 (char const *basedir, char const *const *envp)
else strerr_warnwu2sys("spawn ", stage3) ;
}
-static inline void prepare_shutdown (char c, unsigned int *what, tain_t *deadline, unsigned int *grace_time)
+static inline void prepare_shutdown (buffer *b, char c, unsigned int *what, tain_t *deadline, unsigned int *grace_time)
{
uint32_t u ;
char pack[TAIN_PACK] ;
- ssize_t r = sanitize_read(buffer_get(buffer_0small, pack, TAIN_PACK)) ;
+ ssize_t r = sanitize_read(buffer_get(b, pack, TAIN_PACK)) ;
if (r == -1) strerr_diefu1sys(111, "read from pipe") ;
if (r < TAIN_PACK + 4) strerr_dief1x(101, "bad shutdown protocol") ;
*what = byte_chr("Shpr", c, 4) ;
@@ -98,7 +98,7 @@ static inline void handle_fifo (buffer *b, unsigned int *what, tain_t *deadline,
case 'h' :
case 'p' :
case 'r' :
- prepare_shutdown(c, what, deadline, grace_time) ;
+ prepare_shutdown(b, c, what, deadline, grace_time) ;
break ;
case 'c' :
*what = 0 ;