From bdcbe480fbc8684fcc618adbf94d9a7d1794378a Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 12 May 2014 17:46:48 -0500 Subject: [PATCH] file_io.c: Remove unused full_writev() --- include/wimlib/file_io.h | 3 --- src/file_io.c | 39 --------------------------------------- 2 files changed, 42 deletions(-) diff --git a/include/wimlib/file_io.h b/include/wimlib/file_io.h index 01f97178..9bc9c369 100644 --- a/include/wimlib/file_io.h +++ b/include/wimlib/file_io.h @@ -41,9 +41,6 @@ struct iovec { struct iovec; #endif -extern int -full_writev(struct filedes *fd, struct iovec *iov, int iovcnt); - #ifndef __WIN32__ # define O_BINARY 0 #endif diff --git a/src/file_io.c b/src/file_io.c index 7deaf5e3..014db8cf 100644 --- a/src/file_io.c +++ b/src/file_io.c @@ -206,45 +206,6 @@ full_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset) return 0; } -#if 0 -/* Wrapper around writev() that checks for errors and keep retrying until all - * requested bytes have been written. - * - * Return values: - * WIMLIB_ERR_SUCCESS (0) - * WIMLIB_ERR_WRITE (errno set) - * */ -int -full_writev(struct filedes *fd, struct iovec *iov, int iovcnt) -{ - size_t total_bytes_written = 0; - while (iovcnt > 0) { - ssize_t bytes_written; - - bytes_written = writev(fd->fd, iov, iovcnt); - if (unlikely(bytes_written < 0)) { - if (errno == EINTR) - continue; - return WIMLIB_ERR_WRITE; - } - total_bytes_written += bytes_written; - while (bytes_written) { - if (bytes_written >= iov[0].iov_len) { - bytes_written -= iov[0].iov_len; - iov++; - iovcnt--; - } else { - iov[0].iov_base += bytes_written; - iov[0].iov_len -= bytes_written; - bytes_written = 0; - } - } - } - fd->offset += total_bytes_written; - return 0; -} -#endif - ssize_t raw_pread(struct filedes *fd, void *buf, size_t count, off_t offset) { -- 2.43.0