summaryrefslogtreecommitdiff
path: root/src/libstddjb/buffer_write.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/buffer_write.c')
-rw-r--r--src/libstddjb/buffer_write.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libstddjb/buffer_write.c b/src/libstddjb/buffer_write.c
index e669f60..b924cbb 100644
--- a/src/libstddjb/buffer_write.c
+++ b/src/libstddjb/buffer_write.c
@@ -1,14 +1,11 @@
/* ISC license. */
-#include <sys/types.h>
-#include <sys/uio.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/siovec.h>
#include <skalibs/buffer.h>
int buffer_write (int fd, siovec_t const *v, unsigned int n)
{
- struct iovec iov[n] ;
- iovec_from_siovec(iov, v, n) ;
- return fd_writev(fd, iov, n) ;
+ unsigned int w = allreadwritev(&fd_writesv, fd, v, n) ;
+ return w ? (int)w : -1 ;
}