diff options
author | wm4 <wm4@nowhere> | 2015-04-24 10:59:01 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-24 10:59:19 +0200 |
commit | 9c6417ea88a71691f41a519713975219ca2596b3 (patch) | |
tree | 958f3267d889d55867e31aadb54be77ab7d74afb | |
parent | bf0cb27489b0e0e00190c4ea2e08290fb3817626 (diff) |
terminal: printf() is not signal-safe
We shouldn't call it from a signal handler.
-rw-r--r-- | osdep/terminal-unix.c | 3 |
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)); } } |