aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/powertop.c14
-rw-r--r--procps/top.c1
2 files changed, 9 insertions, 6 deletions
diff --git a/procps/powertop.c b/procps/powertop.c
index ebd659bdb..5d522bf91 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -8,11 +8,6 @@
8 * 8 *
9 * Licensed under GPLv2, see file LICENSE in this source tree. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11
12//applet:IF_POWERTOP(APPLET(powertop, BB_DIR_USR_SBIN, BB_SUID_DROP))
13
14//kbuild:lib-$(CONFIG_POWERTOP) += powertop.o
15
16//config:config POWERTOP 11//config:config POWERTOP
17//config: bool "powertop (9.1 kb)" 12//config: bool "powertop (9.1 kb)"
18//config: default y 13//config: default y
@@ -27,6 +22,10 @@
27//config: Without this, powertop will only refresh display every 10 seconds. 22//config: Without this, powertop will only refresh display every 10 seconds.
28//config: No keyboard commands will work, only ^C to terminate. 23//config: No keyboard commands will work, only ^C to terminate.
29 24
25//applet:IF_POWERTOP(APPLET(powertop, BB_DIR_USR_SBIN, BB_SUID_DROP))
26
27//kbuild:lib-$(CONFIG_POWERTOP) += powertop.o
28
30// XXX This should be configurable 29// XXX This should be configurable
31#define ENABLE_FEATURE_POWERTOP_PROCIRQ 1 30#define ENABLE_FEATURE_POWERTOP_PROCIRQ 1
32 31
@@ -718,7 +717,7 @@ int powertop_main(int UNUSED_PARAM argc, char UNUSED_PARAM **argv)
718 set_termios_to_raw(STDIN_FILENO, &G.init_settings, TERMIOS_CLEAR_ISIG); 717 set_termios_to_raw(STDIN_FILENO, &G.init_settings, TERMIOS_CLEAR_ISIG);
719 bb_signals(BB_FATAL_SIGS, sig_handler); 718 bb_signals(BB_FATAL_SIGS, sig_handler);
720 /* So we don't forget to reset term settings */ 719 /* So we don't forget to reset term settings */
721 atexit(reset_term); 720 die_func = reset_term;
722#endif 721#endif
723 722
724 /* Collect initial data */ 723 /* Collect initial data */
@@ -855,6 +854,9 @@ int powertop_main(int UNUSED_PARAM argc, char UNUSED_PARAM **argv)
855 } /* for (;;) */ 854 } /* for (;;) */
856 855
857 bb_putchar('\n'); 856 bb_putchar('\n');
857#if ENABLE_FEATURE_POWERTOP_INTERACTIVE
858 reset_term();
859#endif
858 860
859 return EXIT_SUCCESS; 861 return EXIT_SUCCESS;
860} 862}
diff --git a/procps/top.c b/procps/top.c
index b9958afa0..f97ded5d6 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -1146,6 +1146,7 @@ int top_main(int argc UNUSED_PARAM, char **argv)
1146 else { 1146 else {
1147 /* Turn on unbuffered input; turn off echoing, ^C ^Z etc */ 1147 /* Turn on unbuffered input; turn off echoing, ^C ^Z etc */
1148 set_termios_to_raw(STDIN_FILENO, &initial_settings, TERMIOS_CLEAR_ISIG); 1148 set_termios_to_raw(STDIN_FILENO, &initial_settings, TERMIOS_CLEAR_ISIG);
1149 die_func = reset_term;
1149 } 1150 }
1150 1151
1151 bb_signals(BB_FATAL_SIGS, sig_catcher); 1152 bb_signals(BB_FATAL_SIGS, sig_catcher);