mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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>
This commit is contained in:
1 parent
da7b74b9bc
commit
7779639a11
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user