diff options
Diffstat (limited to 'lib9p/core_include')
-rw-r--r-- | lib9p/core_include/lib9p/core.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib9p/core_include/lib9p/core.h b/lib9p/core_include/lib9p/core.h index afefa2b..1fb71f1 100644 --- a/lib9p/core_include/lib9p/core.h +++ b/lib9p/core_include/lib9p/core.h @@ -66,19 +66,19 @@ bool lib9p_ctx_has_error(struct lib9p_ctx *ctx); #endif /** Write a <libmisc/fmt.h>-style error into ctx, return -1. */ -#define lib9p_error(ctx, linux_errno, ...) ({ \ - if (!lib9p_ctx_has_error(ctx)) { \ - _lib9p_set_err_num(ctx, linux_errno); \ - struct fmt_buf _w = { \ - .dat = (ctx)->err_msg, \ - .cap = sizeof((ctx)->err_msg), \ - }; \ - lo_interface fmt_dest w = lo_box_fmt_buf_as_fmt_dest(&_w); \ - fmt_print(w, __VA_ARGS__); \ - if (_w.len < _w.cap) \ - memset(_w.dat + _w.len, 0, _w.cap - _w.len); \ - } \ - -1; \ +#define lib9p_error(ctx, linux_errno, ...) ({ \ + if (!lib9p_ctx_has_error(ctx)) { \ + _lib9p_set_err_num(ctx, linux_errno); \ + struct fmt_buf _w = { \ + .dat = (ctx)->err_msg, \ + .cap = sizeof((ctx)->err_msg), \ + }; \ + lo_interface fmt_dest w = LO_BOX(fmt_dest, &_w); \ + fmt_print(w, __VA_ARGS__); \ + if (_w.len < _w.cap) \ + memset(_w.dat + _w.len, 0, _w.cap - _w.len); \ + } \ + -1; \ }) /* misc utilities *************************************************************/ |