summaryrefslogtreecommitdiffstats
path: root/osdep/terminal-unix.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2024-01-06 16:13:22 +0000
committersfan5 <sfan5@live.de>2024-01-15 10:39:42 +0100
commitab60ad861971c5c01c877ee7d0b897ea285bd0e9 (patch)
tree9eafb846efce56c733272fc1b8bebfbe43b4691d /osdep/terminal-unix.c
parentb75b56f91048f0ca8f663b93a92aa059787022ce (diff)
downloadmpv-ab60ad861971c5c01c877ee7d0b897ea285bd0e9.tar.bz2
mpv-ab60ad861971c5c01c877ee7d0b897ea285bd0e9.tar.xz
terminal-unix: don't install handler before pipe
Diffstat (limited to 'osdep/terminal-unix.c')
-rw-r--r--osdep/terminal-unix.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/osdep/terminal-unix.c b/osdep/terminal-unix.c
index 9b22ac26c3..72d0d14899 100644
--- a/osdep/terminal-unix.c
+++ b/osdep/terminal-unix.c
@@ -465,10 +465,6 @@ void terminal_setup_getch(struct input_ctx *ictx)
if (mp_make_wakeup_pipe(death_pipe) < 0)
return;
- if (mp_make_wakeup_pipe(stop_cont_pipe) < 0) {
- close_sig_pipes();
- return;
- }
// Disable reading from the terminal even if stdout is not a tty, to make
// mpv ... | less
@@ -550,6 +546,11 @@ void terminal_init(void)
assert(!getch2_enabled);
getch2_enabled = 1;
+ if (mp_make_wakeup_pipe(stop_cont_pipe) < 0) {
+ getch2_enabled = 0;
+ return;
+ }
+
tty_in = tty_out = open("/dev/tty", O_RDWR | O_CLOEXEC);
if (tty_in < 0) {
tty_in = STDIN_FILENO;