helper: clean up interface
All checks were successful
Test / Create distribution (push) Successful in 26s
Test / Fortify (push) Successful in 2m37s
Test / Fpkg (push) Successful in 3m40s
Test / Data race detector (push) Successful in 3m54s
Test / Flake checks (push) Successful in 59s

The helper interface was messy due to odd context acquisition order. That has changed, so this cleans it up.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-03-15 00:27:44 +09:00
parent 9e18d1de77
commit f443d315ad
8 changed files with 95 additions and 87 deletions

View File

@@ -131,15 +131,15 @@ func Main() {
ctx,
conf, path.Join(fst.Tmp, "sbin/init0"), false,
nil, func(int, int) []string { return make([]string, 0) },
func(cmd *exec.Cmd) { cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr },
extraFiles,
syncFd,
false,
); err != nil {
log.Fatalf("malformed sandbox config: %v", err)
} else {
b.SetStdin(os.Stdin).SetStdout(os.Stdout).SetStderr(os.Stderr)
// run and pass through exit code
if err = b.Start(false); err != nil {
if err = b.Start(); err != nil {
log.Fatalf("cannot start target process: %v", err)
} else if err = b.Wait(); err != nil {
var exitError *exec.ExitError