From 7779639a11b2df96a1ebac309138bfae056229dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 18 May 2016 15:13:04 +0100 Subject: [PATCH] unix,stream: fix getting the correct fd for a handle On OSX it's possible that the fd is replaced, so use the proper libuv API to get the correct fd. PR-URL: https://github.com/nodejs/node/pull/6753 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- src/stream_wrap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index e6236a6e529864..7118a9e573f4c2 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -91,7 +91,7 @@ int StreamWrap::GetFD() { int fd = -1; #if !defined(_WIN32) if (stream() != nullptr) - fd = stream()->io_watcher.fd; + uv_fileno(reinterpret_cast(stream()), &fd); #endif return fd; }