diff --git a/go.mod b/go.mod index b168674..d451036 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3 golang.org/x/sync v0.18.0 + golang.org/x/sys v0.38.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -167,7 +168,6 @@ require ( golang.org/x/crypto v0.44.0 // indirect golang.org/x/net v0.47.0 // indirect golang.org/x/oauth2 v0.26.0 // indirect - golang.org/x/sys v0.38.0 // indirect golang.org/x/term v0.37.0 // indirect golang.org/x/text v0.31.0 // indirect golang.org/x/time v0.9.0 // indirect diff --git a/utils/detached.go b/utils/detached.go index 3675368..6ab5134 100644 --- a/utils/detached.go +++ b/utils/detached.go @@ -9,6 +9,8 @@ import ( "strings" "sync" "syscall" + + "golang.org/x/sys/unix" ) // ReadyMarker is the line a re-exec'd child writes to its notify fd to tell @@ -198,14 +200,14 @@ func RedirectStdio(logPath string) error { } defer out.Close() - if err := syscall.Dup2(int(out.Fd()), int(os.Stdout.Fd())); err != nil { + if err := unix.Dup2(int(out.Fd()), int(os.Stdout.Fd())); err != nil { return fmt.Errorf("detach: redirect stdout: %w", err) } - if err := syscall.Dup2(int(out.Fd()), int(os.Stderr.Fd())); err != nil { + if err := unix.Dup2(int(out.Fd()), int(os.Stderr.Fd())); err != nil { return fmt.Errorf("detach: redirect stderr: %w", err) } if devNull, err := os.OpenFile(os.DevNull, os.O_RDONLY, 0); err == nil { - _ = syscall.Dup2(int(devNull.Fd()), int(os.Stdin.Fd())) + _ = unix.Dup2(int(devNull.Fd()), int(os.Stdin.Fd())) devNull.Close() } return nil