From ad9814de612bbee6c7657ac3e27bcba9b853335e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 26 Feb 2018 14:06:01 +0100 Subject: [PATCH] os: unify supportsCloseOnExec definition On Darwin and FreeBSD, supportsCloseOnExec is defined in its own file, even though it is set to true as on other Unices. Drop the separate definitions but keep the accompanying comments. Change-Id: Iab1d20e1b2590800f141d54b55a099c9cd7ae57e Reviewed-on: https://go-review.googlesource.com/97155 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/os/sys_darwin.go | 11 ----------- src/os/sys_freebsd.go | 10 ---------- src/os/sys_unix.go | 5 ++++- 3 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 src/os/sys_darwin.go delete mode 100644 src/os/sys_freebsd.go diff --git a/src/os/sys_darwin.go b/src/os/sys_darwin.go deleted file mode 100644 index 11d678ef18..0000000000 --- a/src/os/sys_darwin.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package os - -// supportsCloseOnExec reports whether the platform supports the -// O_CLOEXEC flag. -// The O_CLOEXEC flag was introduced in OS X 10.7 (Darwin 11.0.0). -// See http://support.apple.com/kb/HT1633. -const supportsCloseOnExec = true diff --git a/src/os/sys_freebsd.go b/src/os/sys_freebsd.go deleted file mode 100644 index 3ec49faedf..0000000000 --- a/src/os/sys_freebsd.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package os - -// supportsCloseOnExec reports whether the platform supports the -// O_CLOEXEC flag. -// The O_CLOEXEC flag was introduced in FreeBSD 8.3. -const supportsCloseOnExec bool = true diff --git a/src/os/sys_unix.go b/src/os/sys_unix.go index 39c20dc739..87f36cfa4a 100644 --- a/src/os/sys_unix.go +++ b/src/os/sys_unix.go @@ -2,10 +2,13 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build dragonfly linux netbsd openbsd solaris +// +build darwin dragonfly freebsd linux netbsd openbsd solaris package os // supportsCloseOnExec reports whether the platform supports the // O_CLOEXEC flag. +// On Darwin, the O_CLOEXEC flag was introduced in OS X 10.7 (Darwin 11.0.0). +// See http://support.apple.com/kb/HT1633. +// On FreeBSD, the O_CLOEXEC flag was introduced in version 8.3. const supportsCloseOnExec = true -- 2.50.0