summaryrefslogtreecommitdiff
path: root/lib9p/tests
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/tests')
-rw-r--r--lib9p/tests/test_server/fs_flush.c9
-rw-r--r--lib9p/tests/test_server/fs_shutdown.c9
-rw-r--r--lib9p/tests/test_server/fs_whoami.c8
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);