diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-27 08:58:41 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-27 08:58:41 -0600 |
commit | 5a16ac6589817d20749103f45c8d3b4f1eccf784 (patch) | |
tree | 59148ec2255d14c184c7920baaae9766dc2c5ade /lib9p/tests | |
parent | 90f0c59f227b92a046f296865763dc77351782ed (diff) | |
parent | 112b4940c76e22606033acf437b00ad3edbd3c9c (diff) |
Diffstat (limited to 'lib9p/tests')
-rw-r--r-- | lib9p/tests/test_server/fs_flush.c | 9 | ||||
-rw-r--r-- | lib9p/tests/test_server/fs_shutdown.c | 9 | ||||
-rw-r--r-- | lib9p/tests/test_server/fs_whoami.c | 8 |
3 files changed, 17 insertions, 9 deletions
diff --git a/lib9p/tests/test_server/fs_flush.c b/lib9p/tests/test_server/fs_flush.c index e7f3ef1..c8152d4 100644 --- a/lib9p/tests/test_server/fs_flush.c +++ b/lib9p/tests/test_server/fs_flush.c @@ -30,10 +30,12 @@ struct lib9p_qid flush_file_qid(struct flush_file *self) { }; } -lib9p_srv_stat_or_error flush_file_stat(struct flush_file *self, struct lib9p_srv_ctx *ctx) { +error flush_file_stat(struct flush_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat *out) { assert(self); assert(ctx); - return ERROR_NEW_VAL(lib9p_srv_stat, ((struct lib9p_srv_stat){ + assert(out); + + *out = ((struct lib9p_srv_stat){ .qid = flush_file_qid(self), .mode = 0444, .atime_sec = UTIL9P_ATIME, @@ -44,7 +46,8 @@ lib9p_srv_stat_or_error flush_file_stat(struct flush_file *self, struct lib9p_sr .owner_gid = { .name = lib9p_str("root"), .num = 0 }, .last_modifier_uid = { .name = lib9p_str("root"), .num = 0 }, .extension = lib9p_str(NULL), - })); + }); + return ERROR_NULL; } error flush_file_wstat(struct flush_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) { assert(self); diff --git a/lib9p/tests/test_server/fs_shutdown.c b/lib9p/tests/test_server/fs_shutdown.c index d5f2b0d..53a243b 100644 --- a/lib9p/tests/test_server/fs_shutdown.c +++ b/lib9p/tests/test_server/fs_shutdown.c @@ -29,10 +29,12 @@ struct lib9p_qid shutdown_file_qid(struct shutdown_file *self) { }; } -lib9p_srv_stat_or_error shutdown_file_stat(struct shutdown_file *self, struct lib9p_srv_ctx *ctx) { +error shutdown_file_stat(struct shutdown_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat *out) { assert(self); assert(ctx); - return ERROR_NEW_VAL(lib9p_srv_stat, ((struct lib9p_srv_stat){ + assert(out); + + *out = ((struct lib9p_srv_stat){ .qid = shutdown_file_qid(self), .mode = 0222 | LIB9P_DM_APPEND, .atime_sec = UTIL9P_ATIME, @@ -43,7 +45,8 @@ lib9p_srv_stat_or_error shutdown_file_stat(struct shutdown_file *self, struct li .owner_gid = { .name=lib9p_str("root"), .num=0 }, .last_modifier_uid = { .name=lib9p_str("root"), .num=0 }, .extension = lib9p_str(NULL), - })); + }); + return ERROR_NULL; } error shutdown_file_wstat(struct shutdown_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) { assert(self); diff --git a/lib9p/tests/test_server/fs_whoami.c b/lib9p/tests/test_server/fs_whoami.c index 48bd433..a07fdba 100644 --- a/lib9p/tests/test_server/fs_whoami.c +++ b/lib9p/tests/test_server/fs_whoami.c @@ -52,11 +52,12 @@ struct lib9p_qid whoami_file_qid(struct whoami_file *self) { }; } -lib9p_srv_stat_or_error whoami_file_stat(struct whoami_file *self, struct lib9p_srv_ctx *ctx) { +error whoami_file_stat(struct whoami_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat *out) { assert(self); assert(ctx); + assert(out); - return ERROR_NEW_VAL(lib9p_srv_stat, ((struct lib9p_srv_stat){ + *out = ((struct lib9p_srv_stat){ .qid = whoami_file_qid(self), .mode = 0444, .atime_sec = UTIL9P_ATIME, @@ -67,7 +68,8 @@ lib9p_srv_stat_or_error whoami_file_stat(struct whoami_file *self, struct lib9p_ .owner_gid = { .name=lib9p_str("root"), .num=0 }, .last_modifier_uid = { .name=lib9p_str("root"), .num=0 }, .extension = lib9p_str(NULL), - })); + }); + return ERROR_NULL; } error whoami_file_wstat(struct whoami_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) { assert(self); |