summaryrefslogtreecommitdiff
path: root/src/libstddjb/iobufferk_flush.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-02-21 12:05:07 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-02-21 12:05:07 +0000
commit49d8fa1058aaf23c29e074b2314492ae40d2f557 (patch)
tree393f884d5a99f984e992a0f35f1b02ac43536217 /src/libstddjb/iobufferk_flush.c
parentfdffefb8032922ce7ffe4c00816072a8ff2148fc (diff)
downloadskalibs-49d8fa1058aaf23c29e074b2314492ae40d2f557.tar.xz
Types change: big pass on libstddjb and libunixonacid
libdatastruct still missing, library still not functional
Diffstat (limited to 'src/libstddjb/iobufferk_flush.c')
-rw-r--r--src/libstddjb/iobufferk_flush.c16
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