summaryrefslogtreecommitdiff
path: root/lib9p/srv.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/srv.c')
-rw-r--r--lib9p/srv.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib9p/srv.c b/lib9p/srv.c
index e7fdb03..fb74319 100644
--- a/lib9p/srv.c
+++ b/lib9p/srv.c
@@ -113,12 +113,13 @@ static uint32_t rerror_overhead_for_version(enum lib9p_version version,
.version = version,
.max_msg_size = CONFIG_9P_MAX_MSG_SIZE,
};
- struct lib9p_msg_Rerror empty_error = { 0 };
bool e;
- e = lib9p_Rmsg_marshal(&empty_ctx, LIB9P_TYP_Rerror,
- &empty_error, /* host_body */
- scratch); /* net_bytes */
+ e = lib9p_Rmsg_marshal(&empty_ctx,
+ &(struct lib9p_Rmsg){
+ .typ = LIB9P_TYP_Rerror,
+ },
+ scratch);
assert(!e);
uint32_t min_msg_size = decode_u32le(scratch);
@@ -162,8 +163,10 @@ static void respond_error(struct _lib9p_srv_req *req) {
if (((uint32_t)host.ename.len) + sess->rerror_overhead > sess->max_msg_size)
host.ename.len = sess->max_msg_size - sess->rerror_overhead;
- lib9p_Rmsg_marshal(&req->ctx.basectx, LIB9P_TYP_Rerror,
- &host, req->net_bytes);
+ lib9p_Rmsg_marshal(&req->ctx.basectx, &(struct lib9p_Rmsg){
+ .typ = LIB9P_TYP_Rerror,
+ .body = host,
+ }, req->net_bytes);
cr_mutex_lock(&sess->parent_conn->writelock);
r = VCALL(sess->parent_conn->fd, write,