diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-11 10:50:08 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-11 10:50:08 +0100 |
commit | 0fd9fb4244a6dd4ba71f81e355261115cd80d2f1 (patch) | |
tree | 137ad4a92ea3ec969351fca63cb419fe19da6e3a /procps | |
parent | c5891fe1af821dae83a8b1df088462b6989d089b (diff) | |
download | busybox-w32-0fd9fb4244a6dd4ba71f81e355261115cd80d2f1.tar.gz busybox-w32-0fd9fb4244a6dd4ba71f81e355261115cd80d2f1.tar.bz2 busybox-w32-0fd9fb4244a6dd4ba71f81e355261115cd80d2f1.zip |
top: FEATURE_USE_TERMIOS shouldn't control reading of screen size
It controls whether we take input.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps')
-rw-r--r-- | procps/top.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/procps/top.c b/procps/top.c index 71207bac1..491acb574 100644 --- a/procps/top.c +++ b/procps/top.c | |||
@@ -726,7 +726,6 @@ static void clearmems(void) | |||
726 | } | 726 | } |
727 | 727 | ||
728 | #if ENABLE_FEATURE_USE_TERMIOS | 728 | #if ENABLE_FEATURE_USE_TERMIOS |
729 | |||
730 | static void reset_term(void) | 729 | static void reset_term(void) |
731 | { | 730 | { |
732 | if (!OPT_BATCH_MODE) | 731 | if (!OPT_BATCH_MODE) |
@@ -738,7 +737,6 @@ static void sig_catcher(int sig) | |||
738 | reset_term(); | 737 | reset_term(); |
739 | kill_myself_with_sig(sig); | 738 | kill_myself_with_sig(sig); |
740 | } | 739 | } |
741 | |||
742 | #endif /* FEATURE_USE_TERMIOS */ | 740 | #endif /* FEATURE_USE_TERMIOS */ |
743 | 741 | ||
744 | /* | 742 | /* |
@@ -1165,14 +1163,12 @@ int top_main(int argc UNUSED_PARAM, char **argv) | |||
1165 | } else { | 1163 | } else { |
1166 | G.lines = 24; /* default */ | 1164 | G.lines = 24; /* default */ |
1167 | col = 79; | 1165 | col = 79; |
1168 | #if ENABLE_FEATURE_USE_TERMIOS | ||
1169 | /* We output to stdout, we need size of stdout (not stdin)! */ | 1166 | /* We output to stdout, we need size of stdout (not stdin)! */ |
1170 | get_terminal_width_height(STDOUT_FILENO, &col, &G.lines); | 1167 | get_terminal_width_height(STDOUT_FILENO, &col, &G.lines); |
1171 | if (G.lines < 5 || col < 10) { | 1168 | if (G.lines < 5 || col < 10) { |
1172 | sleep(interval); | 1169 | sleep(interval); |
1173 | continue; | 1170 | continue; |
1174 | } | 1171 | } |
1175 | #endif | ||
1176 | if (col > LINE_BUF_SIZE - 2) | 1172 | if (col > LINE_BUF_SIZE - 2) |
1177 | col = LINE_BUF_SIZE - 2; | 1173 | col = LINE_BUF_SIZE - 2; |
1178 | } | 1174 | } |