diff --git a/Makefile b/Makefile index 67c56e2d28..20a04926eb 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,14 @@ uninstall: @$(WAF) uninstall test: all - python tools/test.py --mode=release + python tools/test.py --mode=release simple test-all: all python tools/test.py --mode=debug,release +test-release: all + python tools/test.py --mode=release + test-debug: all python tools/test.py --mode=debug diff --git a/deps/coupling/coupling.c b/deps/coupling/coupling.c index f6b03f38eb..ce29e240ad 100644 --- a/deps/coupling/coupling.c +++ b/deps/coupling/coupling.c @@ -180,7 +180,7 @@ pull_pump (int pullfd, int pushfd) /* eof */ close(pullfd); pullfd = -1; - } else if (r < 0 && errno != EINTR && errno != EAGAIN) { + } else if (r < 0 && errno && errno != EINTR && errno != EAGAIN) { /* error */ perror("pull_pump read()"); close(pullfd); @@ -192,7 +192,7 @@ pull_pump (int pullfd, int pushfd) /* non-blocking write() to the pipe */ r = ring_buffer_push(&ring, pushfd); - if (r < 0 && errno != EAGAIN && errno != EINTR) { + if (r < 0 && errno && errno != EAGAIN && errno != EINTR) { if (errno == EPIPE) { /* This happens if someone closes the other end of the pipe. This * is a normal forced close of STDIN. Hopefully there wasn't data @@ -274,7 +274,7 @@ push_pump (int pullfd, int pushfd) /* eof */ close(pullfd); pullfd = -1; - } else if (r < 0 && errno != EINTR && errno != EAGAIN) { + } else if (r < 0 && errno && errno != EINTR && errno != EAGAIN) { perror("push_pump read()"); close(pullfd); pullfd = -1; @@ -288,14 +288,14 @@ push_pump (int pullfd, int pushfd) /* If there was a problem, just exit the entire function */ - if (r < 0 && errno != EINTR) { + if (r < 0 && errno && errno != EINTR && errno != EAGAIN) { close(pushfd); close(pullfd); pushfd = pullfd = -1; return; } } - + if (pullfd >= 0) { /* select for readability on the pullfd */ r = select(pullfd+1, &readfds, NULL, &exceptfds, NULL); diff --git a/src/node_net.cc b/src/node_net.cc index da43517f11..b9f739c0e5 100644 --- a/src/node_net.cc +++ b/src/node_net.cc @@ -337,7 +337,7 @@ int Connection::AfterResolve(eio_req *req) { if (address_list) freeaddrinfo(address_list); // no error. return. - if (req->result == 0) { + if (req->result == 0 && !r) { evcom_stream_attach(EV_DEFAULT_UC_ &connection->stream_); goto out; } @@ -348,7 +348,13 @@ int Connection::AfterResolve(eio_req *req) { * The fact that I'm modifying a read-only variable here should be * good evidence of this. */ - connection->stream_.errorno = req->result; + + if (req->result) { + connection->stream_.errorno = req->result; + } else { + assert(r); + assert(connection->stream_.errorno); + } connection->OnClose(); diff --git a/test/pummel/test-tcp-pingpong.js b/test/pummel/test-tcp-pingpong.js index 9fa231ee28..c90aa3b167 100644 --- a/test/pummel/test-tcp-pingpong.js +++ b/test/pummel/test-tcp-pingpong.js @@ -82,8 +82,11 @@ function pingPongTest (port, host, on_complete) { /* All are run at once, so run on different ports */ pingPongTest(PORT, "localhost"); pingPongTest(PORT+1, null); -pingPongTest(PORT+2, "::1"); + +// This IPv6 isn't working on Solaris +var solaris = /sunos/i.test(process.platform); +if (!solaris) pingPongTest(PORT+2, "::1"); process.addListener("exit", function () { - assert.equal(3, tests_run); + assert.equal(solaris ? 2 : 3, tests_run); });