Browse Source

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>
v7.x
Saúl Ibarra Corretgé 9 years ago
parent
commit
4fe1d6e75f
  1. 2
      src/stream_wrap.cc

2
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<uv_handle_t*>(stream()), &fd);
#endif
return fd;
}

Loading…
Cancel
Save