]> Cypherpunks repositories - gostls13.git/commit
os: don't trust O_CLOEXEC on OS X
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 20 Dec 2011 23:41:37 +0000 (15:41 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 20 Dec 2011 23:41:37 +0000 (15:41 -0800)
commit1dfe3d1f6e510e7c62cf74240a53d26131042049
tree370b68e391d871983c0b289611c8bde427a9dbfa
parent0735e06cfd9b7e132589f555eca3ab72f26d6e91
os: don't trust O_CLOEXEC on OS X

OS X 10.6 doesn't do O_CLOEXEC.
OS X 10.7 does.

For now, always fall back to using syscall.CloseOnExec on darwin.

This can removed when 10.6 is old news, or if we find a
way to cheaply & reliably detect 10.6 vs 10.7 at runtime.

Fixes #2587

R=golang-dev, rsc, iant
CC=golang-dev
https://golang.org/cl/5500053
src/pkg/os/exec/exec_test.go
src/pkg/os/file_unix.go