unix: correctly detect named pipes on DragonFly

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 <info@bnoordhuis.nl>
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
Michael Neumann 2016-05-23 00:02:54 +02:00 committed by Saúl Ibarra Corretgé
parent 0c82efa4d5
commit 96b37293a9
2 changed files with 5 additions and 5 deletions

View File

@ -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.
*/

View File

@ -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;