r192854 - /trunk/libgo/go/syscall/creds_test.go

ian@gcc.gnu.org ian@gcc.gnu.org
Fri Oct 26 17:50:00 GMT 2012


Author: ian
Date: Fri Oct 26 17:50:10 2012
New Revision: 192854

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192854
Log:
syscall: fix creds_test to reliably close os.File

Uncovered by Uros Bizjak.

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

Modified:
    trunk/libgo/go/syscall/creds_test.go



More information about the Gcc-cvs mailing list