Skip to content

Commit 7779639

Browse files
saghulMyles Borins
authored and
Myles Borins
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 da7b74b commit 7779639

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
@@ -91,7 +91,7 @@ int StreamWrap::GetFD() {
9191
int fd = -1;
9292
#if !defined(_WIN32)
9393
if (stream() != nullptr)
94-
fd = stream()->io_watcher.fd;
94+
uv_fileno(reinterpret_cast<uv_handle_t*>(stream()), &fd);
9595
#endif
9696
return fd;
9797
}

0 commit comments

Comments
 (0)