diff options
author | Jakob Unterwurzacher | 2017-06-18 15:40:38 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-06-18 15:43:22 +0200 |
commit | a4563e21ecaf7d2acce64212c96de69707d6f0bb (patch) | |
tree | 433f9917fdd734f7a06ae854f0713847aaa79f0c /mount.go | |
parent | afc3a8252bacbe15a0815e348aea7071447d7d87 (diff) |
main, syscallcompat: use Dup3 instead of Dup2
Dup2 is not implemented on linux/arm64.
Fixes https://github.com/rfjakob/gocryptfs/issues/121 .
Also adds cross-compilation to CI.
Diffstat (limited to 'mount.go')
-rw-r--r-- | mount.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -25,6 +25,7 @@ import ( "github.com/rfjakob/gocryptfs/internal/fusefrontend" "github.com/rfjakob/gocryptfs/internal/fusefrontend_reverse" "github.com/rfjakob/gocryptfs/internal/readpassword" + "github.com/rfjakob/gocryptfs/internal/syscallcompat" "github.com/rfjakob/gocryptfs/internal/tlog" ) @@ -162,11 +163,11 @@ func redirectStdFds() { tlog.Warn.Printf("redirectStdFds: could not start logger: %v\n", err) } pr.Close() - err = syscall.Dup2(int(pw.Fd()), 1) + err = syscallcompat.Dup3(int(pw.Fd()), 1, 0) if err != nil { tlog.Warn.Printf("redirectStdFds: stdout dup error: %v\n", err) } - syscall.Dup2(int(pw.Fd()), 2) + syscallcompat.Dup3(int(pw.Fd()), 2, 0) if err != nil { tlog.Warn.Printf("redirectStdFds: stderr dup error: %v\n", err) } @@ -178,7 +179,7 @@ func redirectStdFds() { tlog.Warn.Printf("redirectStdFds: could not open /dev/null: %v\n", err) return } - err = syscall.Dup2(int(nullFd.Fd()), 0) + err = syscallcompat.Dup3(int(nullFd.Fd()), 0, 0) if err != nil { tlog.Warn.Printf("redirectStdFds: stdin dup error: %v\n", err) } |