]> Cypherpunks repositories - gostls13.git/commitdiff
os: unify supportsCloseOnExec definition
authorTobias Klauser <tklauser@distanz.ch>
Mon, 26 Feb 2018 13:06:01 +0000 (14:06 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 26 Feb 2018 17:10:24 +0000 (17:10 +0000)
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 <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/os/sys_darwin.go [deleted file]
src/os/sys_freebsd.go [deleted file]
src/os/sys_unix.go

diff --git a/src/os/sys_darwin.go b/src/os/sys_darwin.go
deleted file mode 100644 (file)
index 11d678e..0000000
+++ /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 (file)
index 3ec49fa..0000000
+++ /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
index 39c20dc739523c3f0ca2b713ea28710db41dc558..87f36cfa4af2f1f77364fe41bd10c3c1824e648f 100644 (file)
@@ -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