summaryrefslogtreecommitdiff
path: root/src/supervision/s6-supervise.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-10-12 14:04:28 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-10-12 14:04:28 +0000
commit3315cae54873f180a26a37a5aaccaae5febec96e (patch)
tree70d8ef37fe75831af01c2e84fa32b6b29d25acfa /src/supervision/s6-supervise.c
parent162fcfac5bb4d2cd40f7adc1d2d9ae71d6c86b19 (diff)
downloads6-3315cae54873f180a26a37a5aaccaae5febec96e.tar.xz
Add SIGWINCH support to s6-supervise and s6-svc (-y)
Diffstat (limited to 'src/supervision/s6-supervise.c')
-rw-r--r--src/supervision/s6-supervise.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c
index 4a09eaf..f682040 100644
--- a/src/supervision/s6-supervise.c
+++ b/src/supervision/s6-supervise.c
@@ -26,7 +26,7 @@ typedef enum trans_e trans_t, *trans_t_ref ;
enum trans_e
{
V_TIMEOUT, V_CHLD, V_TERM, V_HUP, V_QUIT,
- V_a, V_b, V_q, V_h, V_k, V_t, V_i, V_1, V_2, V_f, V_F, V_p, V_c,
+ V_a, V_b, V_q, V_h, V_k, V_t, V_i, V_1, V_2, V_f, V_F, V_p, V_c, V_y,
V_o, V_d, V_u, V_x, V_O, V_X
} ;
@@ -178,6 +178,11 @@ static void killc (void)
announce() ;
}
+static void killy (void)
+{
+ kill(status.pid, SIGWINCH) ;
+}
+
static void failcoe (int fd)
{
register int e = errno ;
@@ -440,22 +445,22 @@ static void finish_X (void)
finish_x() ;
}
-static action_t_ref const actions[5][24] =
+static action_t_ref const actions[5][25] =
{
{ &downtimeout, &nop, &bail, &bail, &bail,
- &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop,
+ &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop,
&down_o, &down_d, &down_u, &bail, &down_O, &bail },
{ &uptimeout, &up_z, &up_term, &up_x, &up_X,
- &killa, &killb, &killq, &killh, &killk, &killt, &killi, &kill1, &kill2, &nop, &nop, &killp, &killc,
+ &killa, &killb, &killq, &killh, &killk, &killt, &killi, &kill1, &kill2, &nop, &nop, &killp, &killc, &killy,
&up_o, &up_d, &up_u, &up_x, &up_o, &up_X },
{ &finishtimeout, &finish_z, &finish_x, &finish_x, &finish_X,
- &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop,
+ &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop,
&up_o, &down_d, &finish_u, &finish_x, &up_o, &finish_X },
{ &uptimeout, &lastup_z, &up_d, &nop, &closethem,
- &killa, &killb, &killq, &killh, &killk, &killt, &killi, &kill1, &kill2, &nop, &nop, &killp, &killc,
+ &killa, &killb, &killq, &killh, &killk, &killt, &killi, &kill1, &kill2, &nop, &nop, &killp, &killc, &killy,
&up_o, &up_d, &nop, &nop, &up_o, &closethem },
{ &finishtimeout, &bail, &nop, &nop, &closethem,
- &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop,
+ &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop, &nop,
&nop, &nop, &nop, &nop, &nop, &closethem }
} ;
@@ -536,8 +541,8 @@ static inline void handle_control (int fd)
else if (!r) break ;
else
{
- register unsigned int pos = byte_chr("abqhkti12fFpcoduxOX", 19, c) ;
- if (pos < 19) (*actions[state][V_a + pos])() ;
+ register unsigned int pos = byte_chr("abqhkti12fFpcyoduxOX", 20, c) ;
+ if (pos < 20) (*actions[state][V_a + pos])() ;
}
}
}