Compare commits

...

2 commits

Author SHA1 Message Date
ptrcnull 543e1cdd14 docs: Remove 'proper shutdown' from TODO list 2021-11-30 01:00:35 +01:00
ptrcnull 83a7661a7d feat: Add wait4 loop in main
hey, i know this is ugly
but it works!
2021-11-30 00:59:53 +01:00
3 changed files with 8 additions and 5 deletions

View file

@ -8,4 +8,3 @@ Drop-in replacement for busybox init (kind of)
- askfirst handling
- other devices than /dev/console
- proper shutdown

View file

@ -57,6 +57,12 @@ func main() {
signal.Notify(sigs, syscall.SIGUSR2, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGINT)
go func() {
for {
syscall.Wait4(-1, nil, 0, nil)
}
}()
select {}
}

View file

@ -30,10 +30,8 @@ func Exec(entry InitTabEntry) error {
return fmt.Errorf("spawn: %w", err)
}
err = cmd.Wait()
if err != nil {
return fmt.Errorf("wait: %w", err)
}
// skipping error handling due to wait4 in main
cmd.Wait()
return nil
}