Skip to content

Commit

Permalink
unix,stream: fix getting the correct fd for a handle
Browse files Browse the repository at this point in the history
On OSX it's possible that the fd is replaced, so use the proper libuv
API to get the correct fd.

PR-URL: #6753
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
saghul authored and Myles Borins committed Jul 11, 2016
1 parent 2713f7f commit 2d93202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stream_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2d93202

Please sign in to comment.