summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibuv/src/unix/pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmlibuv/src/unix/pipe.c')
-rw-r--r--Utilities/cmlibuv/src/unix/pipe.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Utilities/cmlibuv/src/unix/pipe.c b/Utilities/cmlibuv/src/unix/pipe.c
index 023e965..7ba1bf8 100644
--- a/Utilities/cmlibuv/src/unix/pipe.c
+++ b/Utilities/cmlibuv/src/unix/pipe.c
@@ -179,6 +179,14 @@ void uv_pipe_connect(uv_connect_t* req,
if (r == -1 && errno != EINPROGRESS) {
err = -errno;
+#if defined(__CYGWIN__) || defined(__MSYS__)
+ /* EBADF is supposed to mean that the socket fd is bad, but
+ Cygwin reports EBADF instead of ENOTSOCK when the file is
+ not a socket. We do not expect to see a bad fd here
+ (e.g. due to new_sock), so translate the error. */
+ if (err == -EBADF)
+ err = -ENOTSOCK;
+#endif
goto out;
}