unix: fail early on bad send_handle in uv_write2
Return UV_EBADF if send_handle doesn't have a valid fd.
This commit is contained in:
parent
26fa6f8031
commit
3f47a2da5c
@ -1203,6 +1203,8 @@ int uv_write2(uv_write_t* req,
|
||||
uv__set_sys_error(stream->loop, EOPNOTSUPP);
|
||||
return -1;
|
||||
}
|
||||
if (uv__stream_fd(send_handle) < 0)
|
||||
return uv__set_sys_error(stream->loop, EBADF);
|
||||
}
|
||||
|
||||
empty_queue = (stream->write_queue_size == 0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user