]> Cypherpunks.ru repositories - gostls13.git/commit
syscall: dup the argument to fdopendir
authorKeith Randall <keithr@alum.mit.edu>
Fri, 5 Apr 2019 16:03:46 +0000 (09:03 -0700)
committerKeith Randall <khr@golang.org>
Fri, 5 Apr 2019 16:42:06 +0000 (16:42 +0000)
commitc7a4099b9926b466b55c7271868d9dfb0271117e
treeaebd74cfce098de1509aef925ce4a63b89f0e343
parentdb0c524211d82af1f632b78c80d22d734c8b1be2
syscall: dup the argument to fdopendir

fdopendir takes ownership of its file descriptor argument.
Getdirentries shouldn't do that, so dup the file descriptor
before passing to fdopendir.

Fixes #31269

Change-Id: Ie36be8fd6c59eb339dcc9f40228d4191fc1e5850
Reviewed-on: https://go-review.googlesource.com/c/go/+/170698
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/syscall/syscall_darwin.go