diff options
Diffstat (limited to 'src/libs6/ftrigw_notifyb_nosig.c')
-rw-r--r-- | src/libs6/ftrigw_notifyb_nosig.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libs6/ftrigw_notifyb_nosig.c b/src/libs6/ftrigw_notifyb_nosig.c index 0a21419..0ba38a6 100644 --- a/src/libs6/ftrigw_notifyb_nosig.c +++ b/src/libs6/ftrigw_notifyb_nosig.c @@ -1,11 +1,10 @@ /* ISC license. */ -#include <sys/types.h> +#include <string.h> #include <unistd.h> #include <errno.h> #include <skalibs/direntry.h> #include <skalibs/allreadwrite.h> -#include <skalibs/bytestr.h> #include <skalibs/djbunix.h> #include "ftrig1.h" #include <s6/ftrigw.h> @@ -16,9 +15,9 @@ int ftrigw_notifyb_nosig (char const *path, char const *s, size_t len) DIR *dir = opendir(path) ; if (!dir) return -1 ; { - size_t pathlen = str_len(path) ; + size_t pathlen = strlen(path) ; char tmp[pathlen + FTRIG1_PREFIXLEN + 45] ; - byte_copy(tmp, pathlen, path) ; + memcpy(tmp, path, pathlen) ; tmp[pathlen] = '/' ; tmp[pathlen + FTRIG1_PREFIXLEN + 44] = 0 ; for (;;) { @@ -27,9 +26,9 @@ int ftrigw_notifyb_nosig (char const *path, char const *s, size_t len) errno = 0 ; d = readdir(dir) ; if (!d) break ; - if (str_diffn(d->d_name, FTRIG1_PREFIX, FTRIG1_PREFIXLEN)) continue ; - if (str_len(d->d_name) != FTRIG1_PREFIXLEN + 43) continue ; - byte_copy(tmp + pathlen + 1, FTRIG1_PREFIXLEN + 43, d->d_name) ; + if (strncmp(d->d_name, FTRIG1_PREFIX, FTRIG1_PREFIXLEN)) continue ; + if (strlen(d->d_name) != FTRIG1_PREFIXLEN + 43) continue ; + memcpy(tmp + pathlen + 1, d->d_name, FTRIG1_PREFIXLEN + 43) ; fd = open_write(tmp) ; if (fd == -1) { @@ -37,7 +36,7 @@ int ftrigw_notifyb_nosig (char const *path, char const *s, size_t len) } else { - register ssize_t r = fd_write(fd, s, len) ; + ssize_t r = fd_write(fd, s, len) ; if ((r < 0) || (size_t)r < len) { if (errno == EPIPE) unlink(tmp) ; |