Halt system on shell exit

This commit is contained in:
Imbus 2025-01-11 15:51:10 +01:00
parent 146e7f65ca
commit bae44d0333

View file

@ -54,7 +54,9 @@ main(void)
// or if a parentless process exits. // or if a parentless process exits.
wpid = wait((int *)0); wpid = wait((int *)0);
if(wpid == pid) { if(wpid == pid) {
// the shell exited; restart it. // FIXME: Obviously not how things should be done
printf("\nShell exited... Halting\n");
halt();
break; break;
} else if(wpid < 0) { } else if(wpid < 0) {
printf("init: wait returned an error\n"); printf("init: wait returned an error\n");