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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
saghul committed May 19, 2016
1 parent f94ebb0 commit 4fe1d6e
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 @@ -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;
}
Expand Down

0 comments on commit 4fe1d6e

Please sign in to comment.