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: nodejs#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 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

1 comment on commit 4fe1d6e

@bnoordhuis
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct PR-URL: nodejs#6838

Please sign in to comment.