diff --git a/libs/libc/uio/lib_writev.c b/libs/libc/uio/lib_writev.c index 02b9fc03269..b8df8ff414d 100644 --- a/libs/libc/uio/lib_writev.c +++ b/libs/libc/uio/lib_writev.c @@ -78,13 +78,8 @@ ssize_t writev(int fildes, FAR const struct iovec *iov, int iovcnt) ssize_t nwritten; size_t remaining; FAR uint8_t *buffer; - off_t pos; int i; - /* Get the current file position in case we have to reset it */ - - pos = lseek(fildes, 0, SEEK_CUR); - /* Process each entry in the struct iovec array */ for (i = 0, ntotal = 0; i < iovcnt; i++) @@ -108,21 +103,6 @@ ssize_t writev(int fildes, FAR const struct iovec *iov, int iovcnt) if (nwritten < 0) { - if (pos != (off_t)-1) - { - /* Save the errno value */ - - int save = get_errno(); - - /* Restore the file position */ - - lseek(fildes, pos, SEEK_SET); - - /* Restore the errno value */ - - set_errno(save); - } - return ntotal ? ntotal : ERROR; }