summaryrefslogtreecommitdiff
path: root/lib9p/tests/test_server/fs_flush.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-06-12 02:32:05 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-06-12 02:32:05 -0600
commit8ce568bae1cc9a77996f16b859482992d27e0b37 (patch)
tree3d88dac69ba2c9bb75bfffcda0e9df627ba0ec32 /lib9p/tests/test_server/fs_flush.c
parent7ddc93c7084e2893cf771dc7b5c027a6303404da (diff)
parentbaa075b9d499f13ea445d1371b5338c9043a95de (diff)
Merge branch 'lukeshu/io-pread'
Diffstat (limited to 'lib9p/tests/test_server/fs_flush.c')
-rw-r--r--lib9p/tests/test_server/fs_flush.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib9p/tests/test_server/fs_flush.c b/lib9p/tests/test_server/fs_flush.c
index 41156ba..0ae905f 100644
--- a/lib9p/tests/test_server/fs_flush.c
+++ b/lib9p/tests/test_server/fs_flush.c
@@ -93,8 +93,8 @@ static uint32_t_or_error flush_fio_pwrite(struct flush_fio *LM_UNUSED(self),
assert_notreached("not writable");
}
-static iovec_or_error flush_fio_pread(struct flush_fio *self, struct lib9p_srv_ctx *ctx,
- uint32_t byte_count, uint64_t LM_UNUSED(byte_offset)) {
+static error flush_fio_pread(struct flush_fio *self, struct lib9p_srv_ctx *ctx,
+ lo_interface io_writer dst, uint64_t LM_UNUSED(src_offset), uint32_t byte_count) {
assert(self);
assert(ctx);
@@ -114,14 +114,11 @@ static iovec_or_error flush_fio_pread(struct flush_fio *self, struct lib9p_srv_c
/* Return */
switch (self->parent->flush_behavior) {
case FLUSH_READ:
- return ERROR_NEW_VAL(iovec, ((struct iovec){
- .iov_base = "Sloth\n",
- .iov_len = 6 < byte_count ? 6 : byte_count,
- }));
+ return io_write(dst, "Sloth\n", 6 < byte_count ? 6 : byte_count).err;
case FLUSH_ERROR:
- return ERROR_NEW_ERR(iovec, error_new(E_POSIX_EAGAIN, "request canceled by flush"));
+ return error_new(E_POSIX_EAGAIN, "request canceled by flush");
case FLUSH_SILENT:
- return ERROR_NEW_ERR(iovec, error_new(E_POSIX_ECANCELED, "request canceled by flush"));
+ return error_new(E_POSIX_ECANCELED, "request canceled by flush");
default:
assert_notreached("invalid flush_behavior");
}