summaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/top.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/procps/top.c b/procps/top.c
index a97e557..172933c 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -388,6 +388,7 @@ static void reset_term(void)
static void sig_catcher(int sig ATTRIBUTE_UNUSED)
{
reset_term();
+ exit(1);
}
#endif /* CONFIG_FEATURE_USE_TERMIOS */
@@ -423,11 +424,7 @@ int top_main(int argc, char **argv)
new_settings.c_lflag &= ~(ECHO | ECHONL);
signal(SIGTERM, sig_catcher);
- sigaction(SIGTERM, (struct sigaction *) 0, &sa);
- sa.sa_flags |= SA_RESTART;
- sa.sa_flags &= ~SA_INTERRUPT;
- sigaction(SIGTERM, &sa, (struct sigaction *) 0);
- sigaction(SIGINT, &sa, (struct sigaction *) 0);
+ signal(SIGINT, sig_catcher);
tcsetattr(0, TCSANOW, (void *) &new_settings);
atexit(reset_term);
#endif /* CONFIG_FEATURE_USE_TERMIOS */