diff options
Diffstat (limited to 'src/libstddjb/writevnclose_unsafe.c')
-rw-r--r-- | src/libstddjb/writevnclose_unsafe.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/libstddjb/writevnclose_unsafe.c b/src/libstddjb/writevnclose_unsafe.c deleted file mode 100644 index 9d2348a..0000000 --- a/src/libstddjb/writevnclose_unsafe.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ISC license. */ - -#include <sys/uio.h> -#include <sys/stat.h> -#include <errno.h> -#include <skalibs/allreadwrite.h> -#include <skalibs/siovec.h> -#include <skalibs/djbunix.h> - -int writevnclose_unsafe_internal (int fd, struct iovec const *v, unsigned int vlen, dev_t *dev, ino_t *ino, int dosync) -{ - struct stat st ; - if (allwritev(fd, v, vlen) < siovec_len(v, vlen)) return 0 ; - if ((dev || ino) && (fstat(fd, &st) < 0)) return 0 ; - if (dosync && (fd_sync(fd) < 0) && (errno != EINVAL)) return 0 ; - fd_close(fd) ; - if (dev) *dev = st.st_dev ; - if (ino) *ino = st.st_ino ; - return 1 ; -} |