diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-03-18 00:34:38 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-05-10 15:15:17 +0300 |
commit | 63a84609fb24b245838f2d0838d5141d36f09f83 (patch) | |
tree | ff305d954ab9faf7f37f2b7a64ac41a715882c82 /src/tty_wrap.cc | |
parent | a928b2d5300ff5a4d6223c59c4e3bda818de5113 (diff) |
src: store fd for libuv streams on Windows
On Windows, we can't just look up a FD for libuv streams and
return it in `GetFD()`.
However, we do sometimes construct streams from their FDs;
in those cases, it should be okay to store the value on a class field.
PR-URL: https://github.com/nodejs/node/pull/19377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r-- | src/tty_wrap.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index d01caba4a55..cd8589cc7fc 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -172,6 +172,7 @@ TTYWrap::TTYWrap(Environment* env, reinterpret_cast<uv_stream_t*>(&handle_), AsyncWrap::PROVIDER_TTYWRAP) { *init_err = uv_tty_init(env->event_loop(), &handle_, fd, readable); + set_fd(fd); if (*init_err != 0) MarkAsUninitialized(); } |