From 0445f2a3590f67441602a05fe3924ab677c79ff0 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 14 Jun 2017 04:09:00 +0000 Subject: Add ftrigr_checksa(), rewrite s6_svlisten_loop() around it - Fixes the race condition hit by permanent failure, i.e. two ftrig events close to each other - Requires storing the sequence of events client-side, so an additional stralloc, bleh - The visible struct ftrigr_s changes, so a major bump is needed -> prepare for 2.6.0.0 - ftrigr_check() is now a trivial wrapper around ftrigr_checksa() --- src/include/s6/ftrigr.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/include') diff --git a/src/include/s6/ftrigr.h b/src/include/s6/ftrigr.h index db91ca9..4afbc97 100644 --- a/src/include/s6/ftrigr.h +++ b/src/include/s6/ftrigr.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -40,11 +41,10 @@ typedef struct ftrigr1_s ftrigr1_t, *ftrigr1_t_ref ; struct ftrigr1_s { uint32_t options ; - unsigned int count ; fr1state_t state ; - char what ; + stralloc what ; } ; -#define FTRIGR1_ZERO { .options = 0, .count = 0, .state = FR1STATE_ERROR, .what = 0 } +#define FTRIGR1_ZERO { .options = 0, .state = FR1STATE_ERROR, .what = STRALLOC_ZERO } extern ftrigr1_t const ftrigr1_zero ; @@ -76,6 +76,7 @@ extern void ftrigr_end (ftrigr_t *) ; #define ftrigr_fd(a) skaclient_fd(&(a)->connection) extern int ftrigr_update (ftrigr_t *) ; extern int ftrigr_check (ftrigr_t *, uint16_t, char *) ; +extern int ftrigr_checksa (ftrigr_t *, uint16_t, stralloc *) ; /* Synchronous functions with timeouts */ -- cgit v1.2.3