mirror of
https://github.com/zap-proto/zip.git
synced 2026-10-19 15:38:57 +00:00
Darwin has no syscall.FcntlInt, so main did not build on a Mac
The descriptor-passing change reached for syscall.FcntlInt, which exists in x/sys/unix and not in Darwin's syscall package, so every build on a Mac has failed since it landed. The last tag builds; main does not, which is the shape that gets noticed late. x/sys/unix is already required, so this adds nothing but the import. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -5,7 +5,8 @@ package zip
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// recvFlags carries no MSG_CMSG_CLOEXEC because Darwin has none. The flag is
|
||||
@@ -15,8 +16,13 @@ import (
|
||||
const recvFlags = 0
|
||||
|
||||
// setCloexec marks a received descriptor close-on-exec.
|
||||
//
|
||||
// Through x/sys/unix rather than syscall: FcntlInt is not in Darwin's syscall
|
||||
// package, so the file this replaces did not compile on a Mac at all — main has
|
||||
// been unbuildable there since the descriptor-passing change landed, while the
|
||||
// last tag builds. unix is already a dependency, so this adds nothing.
|
||||
func setCloexec(fd int) {
|
||||
_, _ = syscall.FcntlInt(uintptr(fd), syscall.F_SETFD, syscall.FD_CLOEXEC)
|
||||
_, _ = unix.FcntlInt(uintptr(fd), unix.F_SETFD, unix.FD_CLOEXEC)
|
||||
}
|
||||
|
||||
// runtimeKeepFiles holds the files alive until the syscall has copied them.
|
||||
|
||||
Reference in New Issue
Block a user