← Commit list

db1ab1aeb

Rob Landley
Rob Landley
2006-06-28
SOURCE BUG Duration: 33s

Subject

Top was catching sigterm (and fumbling sigint) so it could reset the terminal type on the way out, but the signal handler didn't exit. Plus it did unnecessary things with sigaction. This code is overgrown and needs a serious weed-whacking...

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

procps/top.c+2 -5
@@ -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 */