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 <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Saúl Ibarra Corretgé authored and Rod Vagg committed 2016-06-02 22:37:03 +10:00
1 parent 588c76cd5c
commit f3e3eebec8
1 file changed
+1 -1
+1 -1
View File
@@ -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<uv_handle_t*>(stream()), &fd);
#endif
return fd;
}