From 69d7da4945448f4a6901b085e746e977359f465c Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 29 Aug 2022 21:58:15 +0200 Subject: user/termcook: make C-c kill the running process --- src/user/app/init/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/user/app/init/init.c') diff --git a/src/user/app/init/init.c b/src/user/app/init/init.c index 24a0056..b97b483 100644 --- a/src/user/app/init/init.c +++ b/src/user/app/init/init.c @@ -18,10 +18,10 @@ void redirect(const char *exe, const char *out, const char *in) { die("couldn't open %s\n", out); if (!freopen(in, "r", stdin)) die(" couldn't open %s\n", in); - termcook(); for (;;) { if (!fork()) { + termcook(); execv(exe, NULL); fprintf(stderr, "init: couldn't start %s\n", exe); _syscall_sleep(5000); -- cgit v1.2.3