From: Tobias Klauser Date: Fri, 1 Dec 2017 12:57:57 +0000 (+0000) Subject: syscall: reuse BSD forkExecPipe for Solaris X-Git-Tag: go1.11beta1~1715 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=dc27d68936767277984ac731a06cb15c4f64c997;p=gostls13.git syscall: reuse BSD forkExecPipe for Solaris The function was duplicated for Solaris. Reuse the BSD version instead. Change-Id: Ibc812bcf36d21f4a7ceeef7b4fb091fa9479bfa8 Reviewed-on: https://go-review.googlesource.com/81395 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/syscall/exec_solaris.go b/src/syscall/exec_solaris.go index 8052ff1862..9735ae5706 100644 --- a/src/syscall/exec_solaris.go +++ b/src/syscall/exec_solaris.go @@ -261,17 +261,3 @@ childerror: exit(253) } } - -// Try to open a pipe with O_CLOEXEC set on both file descriptors. -func forkExecPipe(p []int) error { - err := Pipe(p) - if err != nil { - return err - } - _, err = fcntl(p[0], F_SETFD, FD_CLOEXEC) - if err != nil { - return err - } - _, err = fcntl(p[1], F_SETFD, FD_CLOEXEC) - return err -} diff --git a/src/syscall/forkpipe_bsd.go b/src/syscall/forkpipe.go similarity index 77% rename from src/syscall/forkpipe_bsd.go rename to src/syscall/forkpipe.go index d41807220a..fa799eb5b9 100644 --- a/src/syscall/forkpipe_bsd.go +++ b/src/syscall/forkpipe.go @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly netbsd openbsd +// +build darwin dragonfly netbsd openbsd solaris package syscall +// Try to open a pipe with O_CLOEXEC set on both file descriptors. func forkExecPipe(p []int) error { err := Pipe(p) if err != nil {