diff options
author | Florian Weimer <fweimer@redhat.com> | 2018-02-02 10:46:26 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2018-02-02 10:46:26 +0100 |
commit | d4b4a00a462348750bb18544eb30853ee6ac5d10 (patch) | |
tree | ede7a1a13907496496c48e436a5b5dc85be3ac2e /sysdeps/posix/pwritev2.c | |
parent | 84c94d2fd90d84ae7e67657ee8e22c2d1b796f63 (diff) | |
download | glibc-d4b4a00a462348750bb18544eb30853ee6ac5d10.tar.gz glibc-d4b4a00a462348750bb18544eb30853ee6ac5d10.tar.xz glibc-d4b4a00a462348750bb18544eb30853ee6ac5d10.zip |
preadv2/pwritev2: Handle offset == -1 [BZ #22753]
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/posix/pwritev2.c')
-rw-r--r-- | sysdeps/posix/pwritev2.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sysdeps/posix/pwritev2.c b/sysdeps/posix/pwritev2.c index 3abf37a810..a39304d9d9 100644 --- a/sysdeps/posix/pwritev2.c +++ b/sysdeps/posix/pwritev2.c @@ -33,7 +33,10 @@ pwritev2 (int fd, const struct iovec *vector, int count, off_t offset, return -1; } - return pwritev (fd, vector, count, offset); + if (offset == -1) + return __writev (fd, vector, count); + else + return pwritev (fd, vector, count, offset); } #endif |