From a896ca2a8c617e5e00ffd5fc9e69331ad754e5b3 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 15 Feb 2017 17:40:40 +0000 Subject: add arc4random_addrandom sysdep; next batch of types changes. The library isn't supposed to be functional yet: there are still a lot of type mismatches. --- src/libstddjb/allreadwritev.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/libstddjb/allreadwritev.c') diff --git a/src/libstddjb/allreadwritev.c b/src/libstddjb/allreadwritev.c index 28695a1..2b06ac7 100644 --- a/src/libstddjb/allreadwritev.c +++ b/src/libstddjb/allreadwritev.c @@ -1,18 +1,20 @@ /* ISC license. */ -#include +#include +#include +#include #include #include -unsigned int allreadwritev (iovfunc_t_ref op, int fd, siovec_t const *v, unsigned int vlen) +size_t allreadwritev (iovfunc_t_ref op, int fd, struct iovec const *v, unsigned int vlen) { - register unsigned int written = 0 ; - siovec_t vv[vlen] ; - for (; written < vlen ; written++) vv[written] = v[written] ; - written = 0 ; + size_t written = 0 ; + struct iovec vv[vlen] ; + unsigned int i = 0 ; + for (; i < vlen ; i++) vv[i] = v[i] ; while (siovec_len(vv, vlen)) { - register int w = (*op)(fd, vv, vlen) ; + register ssize_t w = (*op)(fd, vv, vlen) ; if (w <= 0) break ; w = siovec_seek(vv, vlen, w) ; written += w ; -- cgit v1.2.3