From 24637cd3776cda5fd0a919ba9343ba86d82d3e04 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 18 Mar 2026 01:57:01 +0000 Subject: More fixes, ftrigr_string addition, doc update --- src/supervision/s6-notifyoncheck.c | 6 +++--- src/supervision/s6_svlisten_loop.c | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src/supervision') diff --git a/src/supervision/s6-notifyoncheck.c b/src/supervision/s6-notifyoncheck.c index f86b1e0..ba8e91d 100644 --- a/src/supervision/s6-notifyoncheck.c +++ b/src/supervision/s6-notifyoncheck.c @@ -85,13 +85,13 @@ static inline int handle_signals (pid_t pid, int *w) static int handle_event (ftrigr *a, uint32_t id, pid_t pid) { int r ; - struct iovec v ; + ftrigr_string fs ; if (ftrigr_update(a) == -1) strerr_diefu1sys(111, "ftrigr_update") ; - r = ftrigr_peek(a, id, &v) ; + r = ftrigr_peek(a, id, &fs) ; if (r == -1) strerr_diefu1sys(111, "ftrigr_check") ; if (r) { - if (memchr(v.iov_base, 'd', v.iov_len)) + if (memchr(fs.s, 'd', fs.len)) { if (pid) kill(pid, SIGTERM) ; ftrigr_ack(a, id) ; diff --git a/src/supervision/s6_svlisten_loop.c b/src/supervision/s6_svlisten_loop.c index 4a3e4cf..60e77ad 100644 --- a/src/supervision/s6_svlisten_loop.c +++ b/src/supervision/s6_svlisten_loop.c @@ -70,15 +70,14 @@ unsigned int s6_svlisten_loop (s6_svlisten_t *foo, int wantup, int wantready, in if (ftrigr_update(&foo->a) < 0) strerr_diefu1sys(111, "ftrigr_update") ; for (unsigned int i = 0 ; i < foo->n ; i++) { - struct iovec v ; - r = ftrigr_peek(&foo->a, foo->ids[i], &v) ; + ftrigr_string fs ; + r = ftrigr_peek(&foo->a, foo->ids[i], &fs) ; if (r == -1) strerr_diefu1sys(111, "ftrigr_check") ; else if (r) { - char const *s = v.iov_base ; - for (size_t j = 0 ; j < v.iov_len ; j++) + for (uint32_t j = 0 ; j < fs.len ; j++) { - if (s[j] == 'x') + if (fs.s[j] == 'x') { if (bitarray_peek(foo->upstate, i) != wantup || bitarray_peek(foo->readystate, i) != wantready) @@ -86,7 +85,7 @@ unsigned int s6_svlisten_loop (s6_svlisten_t *foo, int wantup, int wantready, in bitarray_poke(foo->upstate, i, wantup) ; bitarray_poke(foo->readystate, i, wantready) ; } - else if (s[j] == 'O') + else if (fs.s[j] == 'O') { if (wantup) { @@ -97,7 +96,7 @@ unsigned int s6_svlisten_loop (s6_svlisten_t *foo, int wantup, int wantready, in } else { - unsigned int d = byte_chr("dDuU", 4, s[j]) ; + unsigned int d = byte_chr("dDuU", 4, fs.s[j]) ; bitarray_poke(foo->upstate, i, d & 2) ; bitarray_poke(foo->readystate, i, d & 1) ; } -- cgit v1.3.1