bazillion/fuse — pull request #27 by daaku (2014-08-07 00:01:50+00:00)
Title: fix data race in reading Fd and Close of device os.File

specifically running my application with `-race` showed this:

==================
WARNING: DATA RACE
Write by goroutine 25:
os.(*file).close()
/usr/local/Cellar/go/1.3/libexec/src/pkg/os/file_unix.go:108 +0x19b
os.(*File).Close()
/usr/local/Cellar/go/1.3/libexec/src/pkg/os/file_unix.go:97 +0x94
bazil.org/fuse.(*Conn).Close()
/go/src/bazil.org/fuse/fuse.go:368 +0x5d
...

Previous read by goroutine 37:
bazil.org/fuse.(*Conn).fd()
/go/src/bazil.org/fuse/fuse.go:372 +0x80
bazil.org/fuse.(*Conn).respond()
/go/src/bazil.org/fuse/fuse.go:842 +0xdf
bazil.org/fuse.(*DestroyRequest).Respond()
/go/src/bazil.org/fuse/fuse.go:1431 +0xce
bazil.org/fuse/fs.(*serveConn).serve()
/go/src/bazil.org/fuse/fs/serve.go:1168 +0xb8b

Since the fd never changes, reading it once on initialization seems sufficient.