diff options
Diffstat (limited to 'lib9p/tests')
-rw-r--r-- | lib9p/tests/test_server/fs_flush.c | 23 | ||||
-rw-r--r-- | lib9p/tests/test_server/fs_shutdown.c | 23 | ||||
-rw-r--r-- | lib9p/tests/test_server/fs_whoami.c | 23 |
3 files changed, 27 insertions, 42 deletions
diff --git a/lib9p/tests/test_server/fs_flush.c b/lib9p/tests/test_server/fs_flush.c index 821f32d..e6408d7 100644 --- a/lib9p/tests/test_server/fs_flush.c +++ b/lib9p/tests/test_server/fs_flush.c @@ -31,28 +31,23 @@ static struct lib9p_qid flush_file_qid(struct flush_file *self) { }; } -static struct lib9p_stat flush_file_stat(struct flush_file *self, struct lib9p_srv_ctx *ctx) { +static struct lib9p_srv_stat flush_file_stat(struct flush_file *self, struct lib9p_srv_ctx *ctx) { assert(self); assert(ctx); - return (struct lib9p_stat){ - .fstype = 0, - .fsdev = 0, + return (struct lib9p_srv_stat){ .qid = flush_file_qid(self), .mode = 0444, - .atime = UTIL9P_ATIME, - .mtime = UTIL9P_MTIME, - .length = 6, + .atime_sec = UTIL9P_ATIME, + .mtime_sec = UTIL9P_MTIME, + .size = 6, .name = lib9p_str(self->name), - .owner_uname = lib9p_str("root"), - .owner_unum = 0, - .owner_gname = lib9p_str("root"), - .owner_gnum = 0, - .last_modifier_uname = lib9p_str("root"), - .last_modifier_unum = 0, + .owner_uid = { .name = lib9p_str("root"), .num = 0 }, + .owner_gid = { .name = lib9p_str("root"), .num = 0 }, + .last_modifier_uid = { .name = lib9p_str("root"), .num = 0 }, .extension = lib9p_str(NULL), }; } -static void flush_file_wstat(struct flush_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_stat) { +static void flush_file_wstat(struct flush_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) { assert(self); assert(ctx); lib9p_error(&ctx->basectx, LIB9P_ERRNO_L_EROFS, "cannot wstat API file"); diff --git a/lib9p/tests/test_server/fs_shutdown.c b/lib9p/tests/test_server/fs_shutdown.c index 2c3137c..d4ae67e 100644 --- a/lib9p/tests/test_server/fs_shutdown.c +++ b/lib9p/tests/test_server/fs_shutdown.c @@ -30,28 +30,23 @@ static struct lib9p_qid shutdown_file_qid(struct shutdown_file *self) { }; } -static struct lib9p_stat shutdown_file_stat(struct shutdown_file *self, struct lib9p_srv_ctx *ctx) { +static struct lib9p_srv_stat shutdown_file_stat(struct shutdown_file *self, struct lib9p_srv_ctx *ctx) { assert(self); assert(ctx); - return (struct lib9p_stat){ - .fstype = 0, - .fsdev = 0, + return (struct lib9p_srv_stat){ .qid = shutdown_file_qid(self), .mode = 0222 | LIB9P_DM_APPEND, - .atime = UTIL9P_ATIME, - .mtime = UTIL9P_MTIME, - .length = 0, + .atime_sec = UTIL9P_ATIME, + .mtime_sec = UTIL9P_MTIME, + .size = 0, .name = lib9p_str(self->name), - .owner_uname = lib9p_str("root"), - .owner_unum = 0, - .owner_gname = lib9p_str("root"), - .owner_gnum = 0, - .last_modifier_uname = lib9p_str("root"), - .last_modifier_unum = 0, + .owner_uid = { .name=lib9p_str("root"), .num=0 }, + .owner_gid = { .name=lib9p_str("root"), .num=0 }, + .last_modifier_uid = { .name=lib9p_str("root"), .num=0 }, .extension = lib9p_str(NULL), }; } -static void shutdown_file_wstat(struct shutdown_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_stat) { +static void shutdown_file_wstat(struct shutdown_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) { assert(self); assert(ctx); lib9p_error(&ctx->basectx, LIB9P_ERRNO_L_EROFS, "cannot wstat API file"); diff --git a/lib9p/tests/test_server/fs_whoami.c b/lib9p/tests/test_server/fs_whoami.c index c493000..8d9752a 100644 --- a/lib9p/tests/test_server/fs_whoami.c +++ b/lib9p/tests/test_server/fs_whoami.c @@ -52,29 +52,24 @@ static struct lib9p_qid whoami_file_qid(struct whoami_file *self) { }; } -static struct lib9p_stat whoami_file_stat(struct whoami_file *self, struct lib9p_srv_ctx *ctx) { +static struct lib9p_srv_stat whoami_file_stat(struct whoami_file *self, struct lib9p_srv_ctx *ctx) { assert(self); assert(ctx); - return (struct lib9p_stat){ - .fstype = 0, - .fsdev = 0, + return (struct lib9p_srv_stat){ .qid = whoami_file_qid(self), .mode = 0444, - .atime = UTIL9P_ATIME, - .mtime = UTIL9P_MTIME, - .length = whoami_len(ctx), + .atime_sec = UTIL9P_ATIME, + .mtime_sec = UTIL9P_MTIME, + .size = whoami_len(ctx), .name = lib9p_str(self->name), - .owner_uname = lib9p_str("root"), - .owner_unum = 0, - .owner_gname = lib9p_str("root"), - .owner_gnum = 0, - .last_modifier_uname = lib9p_str("root"), - .last_modifier_unum = 0, + .owner_uid = { .name=lib9p_str("root"), .num=0 }, + .owner_gid = { .name=lib9p_str("root"), .num=0 }, + .last_modifier_uid = { .name=lib9p_str("root"), .num=0 }, .extension = lib9p_str(NULL), }; } -static void whoami_file_wstat(struct whoami_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_stat) { +static void whoami_file_wstat(struct whoami_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) { assert(self); assert(ctx); lib9p_error(&ctx->basectx, LIB9P_ERRNO_L_EROFS, "cannot wstat API file"); |