summaryrefslogtreecommitdiff
path: root/lib9p/tests/test_server/fs_whoami.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/tests/test_server/fs_whoami.c')
-rw-r--r--lib9p/tests/test_server/fs_whoami.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib9p/tests/test_server/fs_whoami.c b/lib9p/tests/test_server/fs_whoami.c
index a282cae..5a8382a 100644
--- a/lib9p/tests/test_server/fs_whoami.c
+++ b/lib9p/tests/test_server/fs_whoami.c
@@ -120,8 +120,8 @@ static uint32_t_or_error whoami_fio_pwrite(struct whoami_fio *LM_UNUSED(self),
uint64_t LM_UNUSED(offset)) {
assert_notreached("not writable");
}
-static iovec_or_error whoami_fio_pread(struct whoami_fio *self, struct lib9p_srv_ctx *ctx,
- uint32_t byte_count, uint64_t byte_offset) {
+static error whoami_fio_pread(struct whoami_fio *self, struct lib9p_srv_ctx *ctx,
+ lo_interface io_writer dst, uint64_t byte_offset, uint32_t byte_count) {
assert(self);
assert(ctx);
@@ -134,15 +134,12 @@ static iovec_or_error whoami_fio_pread(struct whoami_fio *self, struct lib9p_srv
ctx->user->num, ctx->user->name.len, ctx->user->name.utf8);
if (byte_offset > (uint64_t)data_size)
- return ERROR_NEW_ERR(iovec, error_new(E_POSIX_EINVAL, "offset is past end-of-file length"));
+ return error_new(E_POSIX_EINVAL, "offset is past end-of-file length");
size_t beg_off = (size_t)byte_offset;
size_t end_off = beg_off + (size_t)byte_count;
if (end_off > data_size)
end_off = data_size;
- return ERROR_NEW_VAL(iovec, ((struct iovec){
- .iov_base = &self->buf[beg_off],
- .iov_len = end_off-beg_off,
- }));
+ return io_write(dst, &self->buf[beg_off], end_off-beg_off).err;
}