summaryrefslogtreecommitdiffstats
path: root/osdep/terminal-unix.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-24 10:59:01 +0200
committerwm4 <wm4@nowhere>2015-04-24 10:59:19 +0200
commit9c6417ea88a71691f41a519713975219ca2596b3 (patch)
tree958f3267d889d55867e31aadb54be77ab7d74afb /osdep/terminal-unix.c
parentbf0cb27489b0e0e00190c4ea2e08290fb3817626 (diff)
downloadmpv-9c6417ea88a71691f41a519713975219ca2596b3.tar.bz2
mpv-9c6417ea88a71691f41a519713975219ca2596b3.tar.xz
terminal: printf() is not signal-safe
We shouldn't call it from a signal handler.
Diffstat (limited to 'osdep/terminal-unix.c')
-rw-r--r--osdep/terminal-unix.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/osdep/terminal-unix.c b/osdep/terminal-unix.c
index d0f40f3a4c..f43376b088 100644
--- a/osdep/terminal-unix.c
+++ b/osdep/terminal-unix.c
@@ -275,8 +275,7 @@ static void enable_kx(bool enable)
// shouldn't be relied on here either.
if (isatty(STDOUT_FILENO)) {
char *cmd = enable ? "\033=" : "\033>";
- printf("%s", cmd);
- fflush(stdout);
+ write(STDOUT_FILENO, cmd, strlen(cmd));
}
}