summaryrefslogtreecommitdiff
path: root/lib9p/9p.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-10 10:26:28 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-10 10:26:28 -0600
commitdb92bd35807305e6daec5ec40bd67cbc43fe88ee (patch)
tree8458933923545c87632e953a1c10a215efa78a0c /lib9p/9p.c
parentbb5afed7a0eeaf361be1e29b3a3ab8ace2865b39 (diff)
lib9p: Implemnt Topen, add permission checks in Twalk
Diffstat (limited to 'lib9p/9p.c')
-rw-r--r--lib9p/9p.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib9p/9p.c b/lib9p/9p.c
index 0e71071..b1d4c32 100644
--- a/lib9p/9p.c
+++ b/lib9p/9p.c
@@ -14,6 +14,8 @@
#include "internal.h"
int lib9p_error(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *msg) {
+ if (lib9p_ctx_has_error(ctx))
+ return -1;
strncpy(ctx->err_msg, msg, sizeof(ctx->err_msg));
ctx->err_msg[sizeof(ctx->err_msg)-1] = '\0';
ctx->err_num = linux_errno;
@@ -24,6 +26,8 @@ int lib9p_errorf(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *fmt, .
int n;
va_list args;
+ if (lib9p_ctx_has_error(ctx))
+ return -1;
va_start(args, fmt);
n = vsnprintf(ctx->err_msg, sizeof(ctx->err_msg), fmt, args);
va_end(args);