aboutsummaryrefslogtreecommitdiff
path: root/src/unix/core.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2024-09-11 10:33:54 +0200
committerGitHub <noreply@github.com>2024-09-11 10:33:54 +0200
commita49f264dff6bc853d67e2d16f635ba8d80bc62a6 (patch)
treee6c03bddb8ebd947f080cff104cd63803c520eb1 /src/unix/core.c
parent44e61dab7effb739f543b8b4eee43f577bf2db49 (diff)
downloadlibuv-a49f264dff6bc853d67e2d16f635ba8d80bc62a6.tar.gz
libuv-a49f264dff6bc853d67e2d16f635ba8d80bc62a6.zip
unix: restore tty attributes on handle close (#4399)
Libuv stores the `struct termios` for use inside uv_tty_reset_mode(). Node.js uses said function to restore the tty to its original mode on SIGINT or SIGTERM, when there is no opportunity to shut down the process normally. Track uv_tty_t handle closing, otherwise we might be trying to use a stale termios. The current solution is not ideal because there can be multiple handles that refer to the same tty/pty and, for various reasons, we can't really determine when we close the last handle. The last handle may not even be inside the current process. Still, all things considered, it's probably (hopefully!) an improvement over the status quo. Refs: https://github.com/libuv/libuv/issues/4398
Diffstat (limited to 'src/unix/core.c')
-rw-r--r--src/unix/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unix/core.c b/src/unix/core.c
index cfa65023..b74552ef 100644
--- a/src/unix/core.c
+++ b/src/unix/core.c
@@ -156,7 +156,7 @@ void uv_close(uv_handle_t* handle, uv_close_cb close_cb) {
break;
case UV_TTY:
- uv__stream_close((uv_stream_t*)handle);
+ uv__tty_close((uv_tty_t*)handle);
break;
case UV_TCP: