joyent/node — pull request #4748 by bnoordhuis (2013-02-11 13:04:02+00:00)
Title: fs: fix immediate WriteStream#end()

Fix an exception that was raised when the WriteStream was closed
immediately after creating it:

TypeError: Cannot read property 'fd' of undefined
at WriteStream.close (fs.js:1537:18)

Avoid the TypeError and make sure the file descriptor is closed.

Fixes #4745.

Reviewer: @isaacs