simple-init

A set of init binaries for linux
git clone git://depsterr.com/git/simple-init
Log | Files | Refs | README | LICENSE

commit 3bef9432e80a1f366df02549f329c76ff0ddccef
parent 63fd3828ecb865e4fb041bca95620d3db7a3c45d
Author: depsterr <depsterr@protonmail.com>
Date:   Sun, 31 May 2020 17:43:56 +0200

added more failchecks to wait for children

Diffstat:
Minitscripts/init.c | 1+
Minitscripts/util.c | 4++--
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/initscripts/init.c b/initscripts/init.c @@ -67,6 +67,7 @@ int main() { log_message("Killing device managers"); + wait_for_children(); log_message("Boot completed, starting ttys"); char* tty1[] = { "/bin/getty", "38400", "tty1", 0 }; char* tty2[] = { "/bin/getty", "38400", "tty2", 0 }; diff --git a/initscripts/util.c b/initscripts/util.c @@ -23,8 +23,8 @@ int spawn_process(char** argv) { void wait_for_children() { int status = 0; while(wait(&status) > 0) { - if (WEXITSTATUS(status) != 0) { - perror("Child exited with non 0 exit code.\nDropping to shell\n"); + if (WEXITSTATUS(status) != 0 || !WIFEXITED(status)) { + perror("Child failed, dropping to shell. Exit shell to continue boot.\n"); char* shellcmd[] = { "/bin/sh", 0 }; int pid; pid = spawn_process(shellcmd);