From bd900b3946607a37b84e7ec5bb241ce377607c18 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sun, 17 Nov 2024 21:51:04 -0700 Subject: cmd/srv9p: Also use init_cr --- cmd/srv9p/main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'cmd') diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c index 076d756..ac61625 100644 --- a/cmd/srv9p/main.c +++ b/cmd/srv9p/main.c @@ -101,10 +101,12 @@ static COROUTINE read_cr(void *_srv) { const char *hexdig = "0123456789abcdef"; -int main() { - struct lib9p_srv srv = { - .rootdir = get_root, - }; +struct lib9p_srv srv = { + .rootdir = get_root, +}; + +static COROUTINE init_cr(void *) { + cr_begin(); for (int i = 0; i < CONFIG_SRV9P_NUM_CONNS; i++) { char name[] = {'r', 'e', 'a', 'd', '-', hexdig[i], '\0'}; @@ -117,6 +119,10 @@ int main() { error(1, 0, "coroutine_add(lib9p_srv_write_cr, &srv)"); } + cr_exit(); +} + +int main() { + coroutine_add("init", init_cr, NULL); coroutine_main(); - return 1; } -- cgit v1.2.3-2-g168b