summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-05-13 15:12:25 +0200
committerKay Sievers <kay@vrfy.org>2013-05-13 15:12:25 +0200
commit9976dcb2f6ed34ae9b54015b75906634ed4b44d8 (patch)
tree86b0464554826b6f111531a039e95b400c0c5c4a
parentc8150fa751ac4490583d1b2c8688a73edb7cd76c (diff)
bus: test-bus-memfd - use pread()/pwrite()
-rw-r--r--src/libsystemd-bus/test-bus-memfd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsystemd-bus/test-bus-memfd.c b/src/libsystemd-bus/test-bus-memfd.c
index db199d46db..05ef555f0d 100644
--- a/src/libsystemd-bus/test-bus-memfd.c
+++ b/src/libsystemd-bus/test-bus-memfd.c
@@ -20,6 +20,7 @@
***/
#include <sys/mman.h>
+#include <sys/uio.h>
#include "log.h"
#include "macro.h"
@@ -151,8 +152,7 @@ int main(int argc, char *argv[]) {
iov[1].iov_len = 3;
iov[2].iov_base = (char *)"GHI";
iov[2].iov_len = 3;
- assert_se(lseek(fd, 0, SEEK_SET) == 0);
- assert_se(writev(fd, iov, 3) == 9);
+ assert_se(pwritev(fd, iov, 3, 0) == 9);
/* readv it back */
iov[0].iov_base = bufv[0];
@@ -161,8 +161,7 @@ int main(int argc, char *argv[]) {
iov[1].iov_len = 3;
iov[2].iov_base = bufv[2];
iov[2].iov_len = 3;
- assert_se(lseek(fd, 0, SEEK_SET) == 0);
- assert_se(readv(fd, iov, 3) == 9);
+ assert_se(preadv(fd, iov, 3, 0) == 9);
/* check content */
assert_se(memcmp(bufv[0], "ABC", 3) == 0);