Skip to content

Commit 2738c01

Browse files
committed
unix: fix Pipe2 on dragonfly
The pipe2 on dragonfly still expects an fds array as an argument, but does not use it to return the file descriptors. Just pass the argument but ignore its value. This way the flags argument will be respected correctly. Change-Id: Id340653040999f31074eae01e9be4ea2088abae5 Reviewed-on: https://go-review.googlesource.com/c/sys/+/295870 Trust: Tobias Klauser <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 8e9945a commit 2738c01

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

unix/syscall_dragonfly.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,16 @@ func Pipe(p []int) (err error) {
105105
return
106106
}
107107

108-
//sysnb pipe2(flags int) (r int, w int, err error)
108+
//sysnb pipe2(p *[2]_C_int, flags int) (r int, w int, err error)
109109

110110
func Pipe2(p []int, flags int) (err error) {
111111
if len(p) != 2 {
112112
return EINVAL
113113
}
114-
p[0], p[1], err = pipe2(flags)
114+
var pp [2]_C_int
115+
// pipe2 on dragonfly takes an fds array as an argument, but still
116+
// returns the file descriptors.
117+
p[0], p[1], err = pipe2(&pp, flags)
115118
return err
116119
}
117120

unix/zsyscall_dragonfly_amd64.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)