diff options
-rw-r--r-- | cmd/srv9p/main.c | 16 |
1 files changed, 11 insertions, 5 deletions
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; } |