diff options
Diffstat (limited to 'src/libstddjb/iobufferk_flush.c')
-rw-r--r-- | src/libstddjb/iobufferk_flush.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/libstddjb/iobufferk_flush.c b/src/libstddjb/iobufferk_flush.c index 674ffec..9bbff7d 100644 --- a/src/libstddjb/iobufferk_flush.c +++ b/src/libstddjb/iobufferk_flush.c @@ -13,7 +13,7 @@ static int iobufferk_flush_0 (iobufferk *k) { while (k->n) { - register int r = splice(k->fd[0], 0, k->p[1], 0, k->n, 0) ; + ssize_t r = splice(k->fd[0], 0, k->p[1], 0, k->n, 0) ; if (r < 0) return 0 ; else if (!r) break ; k->n -= r ; @@ -31,7 +31,7 @@ static int iobufferk_flush_3 (iobufferk *k) { while (k->n) { - register int r = splice(k->p[0], 0, k->fd[1], 0, k->n, SPLICE_F_MORE | (k->nb & 2 ? SPLICE_F_NONBLOCK : 0)) ; + ssize_t r = splice(k->p[0], 0, k->fd[1], 0, k->n, SPLICE_F_MORE | (k->nb & 2 ? SPLICE_F_NONBLOCK : 0)) ; if (r < 0) { if (errno == EINVAL) errno = ENOSYS ; @@ -43,7 +43,7 @@ static int iobufferk_flush_3 (iobufferk *k) return 1 ; } -iobufferk_io_func_t_ref const iobufferk_flush_f[4] = +iobufferk_output_func_t_ref const iobufferk_flush_f[4] = { &iobufferk_flush_0, &fakeflush, &fakeflush, &iobufferk_flush_3 } ; @@ -53,9 +53,15 @@ iobufferk_io_func_t_ref const iobufferk_flush_f[4] = #include <errno.h> #include <skalibs/iobuffer.h> -iobufferk_io_func_t_ref const iobufferk_flush_f[4] = +static int iobufferk_onosys (iobuffer_k *k) { - &iobufferk_nosys, &iobufferk_nosys, &iobufferk_nosys, &iobufferk_nosys + (void)k ; + return (errno = ENOSYS, -1) ; +} + +iobufferk_output_func_t_ref const iobufferk_flush_f[4] = +{ + &iobufferk_onosys, &iobufferk_onosys, &iobufferk_onosys, &iobufferk_onosys } ; #endif |