Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: fix up asserts in core.c and stream.c
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed May 23, 2012
1 parent b69f8ef commit 5fd2c40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/unix/core.c
Expand Up @@ -268,8 +268,8 @@ 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__io_active(&((uv_stream_t*)handle)->read_watcher));
assert(!uv__io_active(&((uv_stream_t*)handle)->write_watcher));
assert(((uv_stream_t*)handle)->fd == -1);
uv__stream_destroy((uv_stream_t*)handle);
break;
Expand Down
8 changes: 4 additions & 4 deletions src/unix/stream.c
Expand Up @@ -626,15 +626,15 @@ static void uv__read(uv_stream_t* stream) {
stream->read2_cb((uv_pipe_t*)stream, -1, buf, UV_UNKNOWN_HANDLE);
}

assert(!ev_is_active(&stream->read_watcher));
assert(!uv__io_active(&stream->read_watcher));
return;
}

} else if (nread == 0) {
/* EOF */
uv__set_artificial_error(stream->loop, UV_EOF);
uv__io_stop(stream->loop, &stream->read_watcher);
if (!ev_is_active(&stream->write_watcher))
if (!uv__io_active(&stream->write_watcher))
uv__handle_stop(stream);

if (stream->read_cb) {
Expand Down Expand Up @@ -1027,6 +1027,6 @@ void uv__stream_close(uv_stream_t* handle) {
handle->accepted_fd = -1;
}

assert(!ev_is_active(&handle->read_watcher));
assert(!ev_is_active(&handle->write_watcher));
assert(!uv__io_active(&handle->read_watcher));
assert(!uv__io_active(&handle->write_watcher));
}

0 comments on commit 5fd2c40

Please sign in to comment.