]> Cypherpunks repositories - gostls13.git/commit
syscall: simplify closing of extra fds in plan9 StartProcess
authorRichard Miller <miller.research@gmail.com>
Fri, 29 Apr 2016 16:39:33 +0000 (17:39 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 5 May 2016 21:58:03 +0000 (21:58 +0000)
commit639a20da908c2646de46b93ca2933651363ec22a
tree1d2a02249eaf454af8f078e3abfae2096e4828a8
parent9b05ae612a4496df317e3c1c770b4b9c5648616d
syscall: simplify closing of extra fds in plan9 StartProcess

Reviving earlier work by @ality in https://golang.org/cl/57890043
to make the closing of extra file descriptors in syscall.StartProcess
less race-prone. Instead of making a list of open fds in the parent
before forking, the child can read through the list of open fds and
close the ones not explicitly requested.  Also eliminate the
complication of keeping open any extra fds which were inherited by
the parent when it started.

This CL will be followed by one to eliminate the ForkLock in plan9,
which is now redundant.

Fixes #5605

Change-Id: I6b4b942001baa54248b656c52dced3b62021c486
Reviewed-on: https://go-review.googlesource.com/22610
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: David du Colombier <0intro@gmail.com>
src/syscall/exec_plan9.go
src/syscall/syscall_plan9.go