summaryrefslogtreecommitdiff
path: root/lib9p/9p.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/9p.c')
-rw-r--r--lib9p/9p.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib9p/9p.c b/lib9p/9p.c
index af1c6ca..fffef31 100644
--- a/lib9p/9p.c
+++ b/lib9p/9p.c
@@ -23,6 +23,11 @@ uint32_t lib9p_ctx_max_msg_size(struct lib9p_ctx *ctx) {
return ctx->max_msg_size;
}
+bool lib9p_ctx_has_error(struct lib9p_ctx *ctx) {
+ assert(ctx);
+ return ctx->err_num || ctx->err_msg[0];
+}
+
int lib9p_error(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *msg) {
strncpy(ctx->err_msg, msg, sizeof(ctx->err_msg));
ctx->err_msg[sizeof(ctx->err_msg)-1] = '\0';