tty fixes for unix

This commit is contained in:
Ryan Dahl 2011-09-20 13:14:16 -07:00
parent c1374ba587
commit 2ef8f359ee
2 changed files with 5 additions and 2 deletions

View File

@ -79,6 +79,7 @@ void uv_close(uv_handle_t* handle, uv_close_cb close_cb) {
uv_pipe_cleanup((uv_pipe_t*)handle);
/* Fall through. */
case UV_TTY:
case UV_TCP:
stream = (uv_stream_t*)handle;
@ -231,6 +232,7 @@ void uv__finish_close(uv_handle_t* handle) {
case UV_NAMED_PIPE:
case UV_TCP:
case UV_TTY:
assert(!ev_is_active(&((uv_stream_t*)handle)->read_watcher));
assert(!ev_is_active(&((uv_stream_t*)handle)->write_watcher));
assert(((uv_stream_t*)handle)->fd == -1);

View File

@ -679,8 +679,9 @@ int uv_write(uv_write_t* req, uv_stream_t* stream, uv_buf_t bufs[], int bufcnt,
uv_write_cb cb) {
int empty_queue;
assert((stream->type == UV_TCP || stream->type == UV_NAMED_PIPE)
&& "uv_write (unix) does not yet support other types of streams");
assert((stream->type == UV_TCP || stream->type == UV_NAMED_PIPE ||
stream->type == UV_TTY) &&
"uv_write (unix) does not yet support other types of streams");
if (stream->fd < 0) {
uv_err_new(stream->loop, EBADF);