From 261946bed05ab1625c85b3d8d29124550e1e1bf9 Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Fri, 13 Nov 2015 03:03:05 +0100 Subject: [PATCH] Fix build on arm64 (fix #208) As per `man dup3`, this is the same as dup2 with empty flags (last argument) and if the two fd arguments are not equal, as is the case here in the fix. --- client/disk/disk.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/disk/disk.go b/client/disk/disk.go index 10a83f8..2392260 100644 --- a/client/disk/disk.go +++ b/client/disk/disk.go @@ -419,7 +419,7 @@ func (sf *StateFile) StartWriter(states chan NewState, done chan struct{}) { if sf.lockFd != nil { // Duplicate the new file descriptor over the old one. // This will unlock the old inode. - if err := syscall.Dup2(newFd, *sf.lockFd); err != nil { + if err := syscall.Dup3(newFd, *sf.lockFd, 0); err != nil { panic(err) } syscall.Close(newFd)