summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/more.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/util-linux/more.c b/util-linux/more.c
index 1fd6f9e..788609a 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -29,16 +29,20 @@ struct globals {
#define new_settings (G.new_settings )
#define cin_fileno (G.cin_fileno )
-#define setTermSettings(fd, argp) do { \
- if (ENABLE_FEATURE_USE_TERMIOS) tcsetattr(fd, TCSANOW, argp); \
- } while (0)
+#define setTermSettings(fd, argp) \
+do { \
+ if (ENABLE_FEATURE_USE_TERMIOS) \
+ tcsetattr(fd, TCSANOW, argp); \
+} while (0)
#define getTermSettings(fd, argp) tcgetattr(fd, argp)
static void gotsig(int sig UNUSED_PARAM)
{
- bb_putchar('\n');
+ /* bb_putchar_stderr doesn't use stdio buffering,
+ * therefore it is safe in signal handler */
+ bb_putchar_stderr('\n');
setTermSettings(cin_fileno, &initial_settings);
- exit(EXIT_FAILURE);
+ _exit(EXIT_FAILURE);
}
#define CONVERTED_TAB_SIZE 8