diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2026-03-18 01:57:01 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2026-03-18 01:57:01 +0000 |
| commit | 24637cd3776cda5fd0a919ba9343ba86d82d3e04 (patch) | |
| tree | dac9d66860d763fedc999ace6e1a5f37d3add229 /src/supervision | |
| parent | 4cdcab0506e76666800d2bc111c602bb3154cc30 (diff) | |
| download | s6-24637cd3776cda5fd0a919ba9343ba86d82d3e04.tar.gz | |
More fixes, ftrigr_string addition, doc update
Diffstat (limited to 'src/supervision')
| -rw-r--r-- | src/supervision/s6-notifyoncheck.c | 6 | ||||
| -rw-r--r-- | src/supervision/s6_svlisten_loop.c | 13 |
2 files changed, 9 insertions, 10 deletions
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) ; } |
