diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-11 12:16:25 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-11 12:16:25 +0000 |
commit | 1b5312d5c01fd5e12b938cfe65cda562e822619d (patch) | |
tree | 60f086613e97aae5cb2635b8b9e3251c7b3c55cf /src/skaembutils/s6-tail.c | |
parent | ac77200b30d6c8bbe9093655dd0f8d8bf6e88feb (diff) | |
download | s6-portable-utils-1b5312d5c01fd5e12b938cfe65cda562e822619d.tar.xz |
Adapt to skalibs-2.5.0.0
Diffstat (limited to 'src/skaembutils/s6-tail.c')
-rw-r--r-- | src/skaembutils/s6-tail.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/skaembutils/s6-tail.c b/src/skaembutils/s6-tail.c index 4c71f9c..479f950 100644 --- a/src/skaembutils/s6-tail.c +++ b/src/skaembutils/s6-tail.c @@ -1,11 +1,11 @@ /* ISC license. */ #include <sys/types.h> +#include <sys/uio.h> #include <errno.h> #include <skalibs/sgetopt.h> #include <skalibs/allreadwrite.h> -#include <skalibs/bytestr.h> -#include <skalibs/uint.h> +#include <skalibs/types.h> #include <skalibs/buffer.h> #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> @@ -23,14 +23,14 @@ static int pluslines (int fd, size_t n) { char buf[BUFFER_INSIZE] ; buffer b = BUFFER_INIT(&buffer_read, fd, buf, BUFFER_INSIZE) ; - unsigned int count = 0 ; + size_t count = 0 ; while (count < n) { - register ssize_t r = buffer_fill(&b) ; + ssize_t r = buffer_fill(&b) ; if (r <= 0) return !r ; while (!buffer_isempty(&b) && (count < n)) { - siovec_t v[2] ; + struct iovec v[2] ; size_t i ; buffer_rpeek(&b, v) ; i = siovec_bytechr(v, 2, '\n') ; @@ -56,7 +56,7 @@ static int pluschars (int fd, size_t n) if (nil < 0) return 0 ; if (!fd_catn(fd, nil, n)) { - register int e = errno ; + int e = errno ; fd_close(nil) ; errno = e ; return 0 ; @@ -76,7 +76,7 @@ static int minuslines (int fd, size_t n) head = 0 ; for (;;) { - register int r ; + int r ; r = skagetln(&b, tab + tail, '\n') ; if (!r) break ; if (r < 0) @@ -110,7 +110,7 @@ static int minuschars (int fd, size_t n) buffer b = BUFFER_INIT(&buffer_read, fd, buf, BUFFER_INSIZE + n) ; for (;;) { - register ssize_t r = buffer_fill(&b) ; + ssize_t r = buffer_fill(&b) ; if (!r) break ; if (r < 0) return 0 ; buffer_rseek(&b, buffer_len(&b)) ; @@ -131,7 +131,7 @@ int main (int argc, char const *const *argv) subgetopt_t l = SUBGETOPT_ZERO ; for (;;) { - register int opt = subgetopt_r(argc, argv, "123456789n:c:", &l) ; + int opt = subgetopt_r(argc, argv, "123456789n:c:", &l) ; if (opt == -1) break ; switch (opt) { |