]> Cypherpunks repositories - gostls13.git/commit
syscall: fix creds_test to reliably close os.File
authorIan Lance Taylor <iant@golang.org>
Fri, 26 Oct 2012 17:31:03 +0000 (10:31 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 26 Oct 2012 17:31:03 +0000 (10:31 -0700)
commit5611e8b59fe338ca8dcb6790d569e77c2a78785f
tree62b425e9462cda10dc0122f9c6fa85db3366d337
parentf9902c7197f436578e8fafa7946d8cd83467729e
syscall: fix creds_test to reliably close os.File

Before this patch the test would close the file descriptor but
not the os.File.  When the os.File was GC'ed, the finalizer
would close the file descriptor again.  That would cause
problems if the same file descriptor were returned by a later
call to open in another test.

On my system:

> GOGC=30 go test
--- FAIL: TestPassFD (0.04 seconds)
passfd_test.go:62:  FileConn: dup: bad file descriptor
FAIL

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6776053
src/pkg/syscall/creds_test.go