Skip to content

Commit 4fe1d6e

Browse files
committed
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: #6753 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent f94ebb0 commit 4fe1d6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stream_wrap.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int StreamWrap::GetFD() {
8686
int fd = -1;
8787
#if !defined(_WIN32)
8888
if (stream() != nullptr)
89-
fd = stream()->io_watcher.fd;
89+
uv_fileno(reinterpret_cast<uv_handle_t*>(stream()), &fd);
9090
#endif
9191
return fd;
9292
}

0 commit comments

Comments
 (0)