Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

Use Dup2 library function instead of raw syscall

Fredrik Fornwall87db3cfad382
diff --git a/cmd/redirect_stderr_unix.go b/cmd/redirect_stderr_unix.go
index f31c8e062..bc1177ad3 100644
--- a/cmd/redirect_stderr_unix.go
+++ b/cmd/redirect_stderr_unix.go
@@ -7,12 +7,13 @@ package cmd
import (
"log"
"os"
- "syscall"
+
+ "golang.org/x/sys/unix"
)
// redirectStderr to the file passed in
func redirectStderr(f *os.File) {
- err := syscall.Dup2(int(f.Fd()), int(os.Stderr.Fd()))
+ err := unix.Dup2(int(f.Fd()), int(os.Stderr.Fd()))
if err != nil {
log.Fatalf("Failed to redirect stderr to file: %v", err)
}