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>
v4.x
Saúl Ibarra Corretgé 9 years ago
committed by Myles Borins
parent
commit
7779639a11
  1. 2
      src/stream_wrap.cc

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

Loading…
Cancel
Save