diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-04 21:48:59 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-06 23:01:30 -0600 |
commit | c8b62bcbb5e18b3ca643acedee7fda0c45460b62 (patch) | |
tree | 09d87a75d4cb293643feca660e20ade88edd0963 /lib9p/tests/test_server/main.c | |
parent | b5a29a4c57f09ed11b4591f99493fd57fdcee593 (diff) |
host: Avoid the "error" sym
Diffstat (limited to 'lib9p/tests/test_server/main.c')
-rw-r--r-- | lib9p/tests/test_server/main.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib9p/tests/test_server/main.c b/lib9p/tests/test_server/main.c index 052d180..6c7dc1c 100644 --- a/lib9p/tests/test_server/main.c +++ b/lib9p/tests/test_server/main.c @@ -5,10 +5,13 @@ */ #include <errno.h> -#include <error.h> #include <stdio.h> #include <stdlib.h> /* for atoi() */ +#define error __error +#include <error.h> +#undef error + #include <lib9p/srv.h> #include <libcr/coroutine.h> #include <libhw/generic/alarmclock.h> @@ -117,12 +120,12 @@ static COROUTINE init_cr(void *) { for (int i = 0; i < _CONFIG_9P_MAX_CONNS; i++) { char name[] = {'r', 'e', 'a', 'd', '-', hexdig[i], '\0'}; if (!coroutine_add(name, read_cr, &i)) - error(1, 0, "coroutine_add(read_cr, &i)"); + __error(1, 0, "coroutine_add(read_cr, &i)"); } for (int i = 0; i < _CONFIG_9P_MAX_REQS; i++) { char name[] = {'w', 'r', 'i', 't', 'e', '-', hexdig[i], '\0'}; if (!coroutine_add(name, write_cr, NULL)) - error(1, 0, "coroutine_add(write_cr, NULL)"); + __error(1, 0, "coroutine_add(write_cr, NULL)"); } cr_exit(); @@ -153,12 +156,12 @@ static void tstlog_msg(struct lib9p_srv_ctx *ctx, enum lib9p_msg_type typ, void int main(int argc, char *argv[]) { if (argc != 3) - error(2, 0, "usage: %s PORT_NUMBER LOGFILE", argv[0]); + __error(2, 0, "usage: %s PORT_NUMBER LOGFILE", argv[0]); globals.port = atoi(argv[1]); globals.logstream = fopen(argv[2], "w"); if (!globals.logstream) - error(2, errno, "fopen"); + __error(2, errno, "fopen"); globals.srv.msglog = tstlog_msg; struct hostclock clock_monotonic = { |