… | |
… | |
547 | if (sock [0] != INVALID_SOCKET) closesocket (sock [0]); |
547 | if (sock [0] != INVALID_SOCKET) closesocket (sock [0]); |
548 | if (sock [1] != INVALID_SOCKET) closesocket (sock [1]); |
548 | if (sock [1] != INVALID_SOCKET) closesocket (sock [1]); |
549 | |
549 | |
550 | return -1; |
550 | return -1; |
551 | } |
551 | } |
|
|
552 | |
|
|
553 | #define pipe(filedes) ev_pipe(filedes) |
552 | #endif |
554 | #endif |
553 | |
555 | |
554 | static void |
556 | static void |
555 | create_respipe (void) |
557 | create_respipe (void) |
556 | { |
558 | { |
… | |
… | |
560 | int old_readfd = respipe [0]; |
562 | int old_readfd = respipe [0]; |
561 | |
563 | |
562 | if (respipe [1] >= 0) |
564 | if (respipe [1] >= 0) |
563 | respipe_close (TO_SOCKET (respipe [1])); |
565 | respipe_close (TO_SOCKET (respipe [1])); |
564 | |
566 | |
565 | #ifdef _WIN32 |
|
|
566 | if (ev_pipe (respipe)) |
|
|
567 | #else |
|
|
568 | if (pipe (respipe)) |
567 | if (pipe (respipe)) |
569 | #endif |
|
|
570 | croak ("unable to initialize result pipe"); |
568 | croak ("unable to initialize result pipe"); |
571 | |
569 | |
572 | if (old_readfd >= 0) |
570 | if (old_readfd >= 0) |
573 | { |
571 | { |
574 | if (dup2 (TO_SOCKET (respipe [0]), TO_SOCKET (old_readfd)) < 0) |
572 | if (dup2 (TO_SOCKET (respipe [0]), TO_SOCKET (old_readfd)) < 0) |