feat: Add wait4 loop in main

hey, i know this is ugly
but it works!
master
ptrcnull 10 months ago
parent 180881639b
commit 83a7661a7d
  1. 6
      main.go
  2. 6
      process.go

@ -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 {}
}

@ -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
}

Loading…
Cancel
Save