]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: reuse BSD forkExecPipe for Solaris
authorTobias Klauser <tklauser@distanz.ch>
Fri, 1 Dec 2017 12:57:57 +0000 (12:57 +0000)
committerTobias Klauser <tobias.klauser@gmail.com>
Tue, 13 Feb 2018 15:35:36 +0000 (15:35 +0000)
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 <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/syscall/exec_solaris.go
src/syscall/forkpipe.go [moved from src/syscall/forkpipe_bsd.go with 77% similarity]

index 8052ff186214373e201c93988b1a24749b381bc8..9735ae570671cb42d22bfaf84e0b861e2f1d9399 100644 (file)
@@ -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
-}
similarity index 77%
rename from src/syscall/forkpipe_bsd.go
rename to src/syscall/forkpipe.go
index d41807220aa31bf984c0bf81fad53f87065e9d2a..fa799eb5b9321e764edd0fd78404e9a19b673e59 100644 (file)
@@ -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 {