From 96b37293a9a6a4f100e117b9760aaac3e39f94ee Mon Sep 17 00:00:00 2001 From: Michael Neumann Date: Mon, 23 May 2016 00:02:54 +0200 Subject: [PATCH] unix: correctly detect named pipes on DragonFly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes test-stdio-over-pipes and test-pipe-sendmsg test cases. ~~~~ Assertion failed in test/test-stdio-over-pipes.c on line 56: term_signal == 0 Assertion failed in test/test-pipe-sendmsg.c on line 86: pending == UV_NAMED_PIPE ~~~~ This fixes a longstanding issue with nodejs on DragonFly, which was triggered whenever spawning a process and pipes were involed. PR-URL: https://github.com/libuv/libuv/pull/884 Reviewed-By: Ben Noordhuis Reviewed-By: Imran Iqbal Reviewed-By: Saúl Ibarra Corretgé --- src/unix/stream.c | 4 ++-- src/unix/tty.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/unix/stream.c b/src/unix/stream.c index 7dbc556f..eaec92bb 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -962,8 +962,8 @@ uv_handle_type uv__handle_type(int fd) { return UV_UNKNOWN_HANDLE; if (type == SOCK_STREAM) { -#if defined(_AIX) - /* on AIX the getsockname call returns an empty sa structure +#if defined(_AIX) || defined(__DragonFly__) + /* on AIX/DragonFly the getsockname call returns an empty sa structure * for sockets of type AF_UNIX. For all other types it will * return a properly filled in structure. */ diff --git a/src/unix/tty.c b/src/unix/tty.c index ca108712..a56afe18 100644 --- a/src/unix/tty.c +++ b/src/unix/tty.c @@ -289,14 +289,14 @@ uv_handle_type uv_guess_handle(uv_file file) { return UV_UDP; if (type == SOCK_STREAM) { -#if defined(_AIX) - /* on AIX the getsockname call returns an empty sa structure +#if defined(_AIX) || defined(__DragonFly__) + /* on AIX/DragonFly the getsockname call returns an empty sa structure * for sockets of type AF_UNIX. For all other types it will * return a properly filled in structure. */ if (len == 0) return UV_NAMED_PIPE; -#endif /* defined(_AIX) */ +#endif /* defined(_AIX) || defined(__DragonFly__) */ if (sa.sa_family == AF_INET || sa.sa_family == AF_INET6) return UV_TCP;