terminal: printf() is not signal-safe

We shouldn't call it from a signal handler.
This commit is contained in:
wm4 2015-04-24 10:59:01 +02:00
parent bf0cb27489
commit 9c6417ea88
1 changed files with 1 additions and 2 deletions

View File

@ -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));
}
}