diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-12 11:59:43 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-12 11:59:43 +0000 |
commit | c60ebd422171808ad58b936914055397bb205bef (patch) | |
tree | 7db3e5728d72ad209f8e22b9eb9f337e0b0c3e58 /src/libs6/s6-ftrigrd.c | |
parent | e28fe5908a91d8795ca9923d64eeed7d3e898434 (diff) | |
download | s6-c60ebd422171808ad58b936914055397bb205bef.tar.xz |
Adapt to skalibs-2.5.0.0
Diffstat (limited to 'src/libs6/s6-ftrigrd.c')
-rw-r--r-- | src/libs6/s6-ftrigrd.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/libs6/s6-ftrigrd.c b/src/libs6/s6-ftrigrd.c index 1bbe856..5afec98 100644 --- a/src/libs6/s6-ftrigrd.c +++ b/src/libs6/s6-ftrigrd.c @@ -1,13 +1,11 @@ /* ISC license. */ -#include <sys/types.h> +#include <string.h> #include <stdint.h> #include <errno.h> #include <signal.h> #include <regex.h> -#include <skalibs/uint16.h> -#include <skalibs/uint32.h> -#include <skalibs/bytestr.h> +#include <skalibs/types.h> #include <skalibs/allreadwrite.h> #include <skalibs/error.h> #include <skalibs/strerr2.h> @@ -53,7 +51,7 @@ static void ftrigio_deepfree (ftrigio_t *p) static void cleanup (void) { - register unsigned int i = 0 ; + unsigned int i = 0 ; for (; i < n ; i++) ftrigio_deepfree(a + i) ; n = 0 ; } @@ -95,7 +93,7 @@ static inline int ftrigio_read (ftrigio_t *p) { regmatch_t pmatch ; size_t blen ; - register ssize_t r = sanitize_read(buffer_fill(&p->b)) ; + ssize_t r = sanitize_read(buffer_fill(&p->b)) ; if (!r) break ; if (r < 0) return (trig(p->id, 'd', errno), 0) ; blen = buffer_len(&p->b) ; @@ -107,7 +105,7 @@ static inline int ftrigio_read (ftrigio_t *p) { trig(p->id, '!', p->sa.s[pmatch.rm_eo - 1]) ; if (!(p->options & FTRIGR_REPEAT)) return 0 ; - byte_copy(p->sa.s, p->sa.len + 1 - pmatch.rm_eo, p->sa.s + pmatch.rm_eo) ; + memcpy(p->sa.s, p->sa.s + pmatch.rm_eo, p->sa.len + 1 - pmatch.rm_eo) ; p->sa.len -= pmatch.rm_eo ; } } @@ -127,7 +125,7 @@ static int parse_protocol (unixmessage_t const *m, void *context) { case 'U' : /* unsubscribe */ { - register unsigned int i = 0 ; + unsigned int i = 0 ; for (; i < n ; i++) if (a[i].id == id) break ; if (i < n) { |