From 4fe1d6e75fe6daa19150038c7fdb2de0f91c10fa 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 695e917e027604..b942e48078e29a 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -86,7 +86,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; }