joyent/libuv — pull request #716 by saghul (2013-02-21 09:05:29+00:00)
Title: Gentle check for send_handle on uv_write2

As discussed on the mailing list.

I added an extra check, which checks for the send_handle fd and fails early with EBADF. The assert is still there, but I guess the only case when it would blow up is if something really weird happens.

I went for checking the fd in stream and send_handle the same, instead of checking for stream and asserting for send_handle.

Since I was there, I removed a few lines of code by returning directly the value from uv__set_sys_error.