summaryrefslogtreecommitdiff
path: root/deps/uv/test/test-shutdown-eof.c
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-06-22 14:06:26 +0200
committerRyan Dahl <ry@tinyclouds.org>2011-06-28 13:37:03 +0200
commitf657d58fe1b47c67dabcd19fab31907e5f4eb784 (patch)
treee618ffc992288363982fcf61314467bb10769192 /deps/uv/test/test-shutdown-eof.c
parent6c121edc6008ad502317b7a3c12e8a78b92217c7 (diff)
downloadandroid-node-v8-f657d58fe1b47c67dabcd19fab31907e5f4eb784.tar.gz
android-node-v8-f657d58fe1b47c67dabcd19fab31907e5f4eb784.tar.bz2
android-node-v8-f657d58fe1b47c67dabcd19fab31907e5f4eb784.zip
Upgrade libuv to f9b9bb44bd6e2b74729b5d1ff481adf4213e9a0b
Diffstat (limited to 'deps/uv/test/test-shutdown-eof.c')
-rw-r--r--deps/uv/test/test-shutdown-eof.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/deps/uv/test/test-shutdown-eof.c b/deps/uv/test/test-shutdown-eof.c
index 1ce81f71be..8964507133 100644
--- a/deps/uv/test/test-shutdown-eof.c
+++ b/deps/uv/test/test-shutdown-eof.c
@@ -46,8 +46,16 @@ static uv_buf_t alloc_cb(uv_tcp_t* tcp, size_t size) {
static void read_cb(uv_tcp_t* t, ssize_t nread, uv_buf_t buf) {
+ uv_err_t err = uv_last_error();
+
ASSERT(t == &tcp);
+ if (nread == 0) {
+ ASSERT(err.code == UV_EAGAIN);
+ free(buf.base);
+ return;
+ }
+
if (!got_q) {
ASSERT(nread == 1);
ASSERT(!got_eof);
@@ -56,7 +64,7 @@ static void read_cb(uv_tcp_t* t, ssize_t nread, uv_buf_t buf) {
got_q = 1;
puts("got Q");
} else {
- ASSERT(uv_last_error().code == UV_EOF);
+ ASSERT(err.code == UV_EOF);
if (buf.base) {
free(buf.base);
}
@@ -120,9 +128,9 @@ void timer_close_cb(uv_handle_t* handle) {
}
-void timer_cb(uv_handle_t* handle, int status) {
- ASSERT(handle == (uv_handle_t*) &timer);
- uv_close(handle, timer_close_cb);
+void timer_cb(uv_timer_t* handle, int status) {
+ ASSERT(handle == &timer);
+ uv_close((uv_handle_t*) handle, timer_close_cb);
/*
* The most important assert of the test: we have not received