summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-06-14 04:09:00 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-06-14 04:09:00 +0000
commit0445f2a3590f67441602a05fe3924ab677c79ff0 (patch)
tree1a011697fbd92ca53468efe019c8c93c364ad6a8 /src/include
parentf287ac765101f21b530f1a9886e06976c165c922 (diff)
downloads6-0445f2a3590f67441602a05fe3924ab677c79ff0.tar.xz
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()
Diffstat (limited to 'src/include')
-rw-r--r--src/include/s6/ftrigr.h7
1 files changed, 4 insertions, 3 deletions
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 <stdint.h>
#include <skalibs/config.h>
#include <skalibs/tai.h>
+#include <skalibs/stralloc.h>
#include <skalibs/genalloc.h>
#include <skalibs/gensetdyn.h>
#include <skalibs/skaclient.h>
@@ -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 */