mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-21 22:21:41 +00:00
logtail/filch: use x/sys/unix instead of syscall.
In particular, the Dup2 syscall is not defined in the syscall package on arm64, but is defined in x/sys/unix. Signed-off-by: David Anderson <dave@natulte.net>
This commit is contained in:
parent
a416d10e85
commit
de0239375a
@ -8,11 +8,12 @@ package filch
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"syscall"
|
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
func saveStderr() (*os.File, error) {
|
func saveStderr() (*os.File, error) {
|
||||||
fd, err := syscall.Dup(stderrFD)
|
fd, err := unix.Dup(stderrFD)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -26,5 +27,5 @@ func unsaveStderr(f *os.File) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func dup2Stderr(f *os.File) error {
|
func dup2Stderr(f *os.File) error {
|
||||||
return syscall.Dup2(int(f.Fd()), stderrFD)
|
return unix.Dup2(int(f.Fd()), stderrFD)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user