summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-17 21:51:04 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-19 20:15:48 -0700
commitbd900b3946607a37b84e7ec5bb241ce377607c18 (patch)
tree89dc21e081cca7fc06724966c164734ccbf1eb91 /cmd
parent5e04cdf350f9cede59263b52c2271f7c066439e3 (diff)
cmd/srv9p: Also use init_cr
Diffstat (limited to 'cmd')
-rw-r--r--cmd/srv9p/main.c16
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;
}