From f8e940c52cd4016821e582cfbf1458084d4229c8 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 21 May 2014 07:57:48 -0500 Subject: Convert bootchartd to generic_signal(). --- toys/pending/bootchartd.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/toys/pending/bootchartd.c b/toys/pending/bootchartd.c index 9b943215..6839b2ca 100644 --- a/toys/pending/bootchartd.c +++ b/toys/pending/bootchartd.c @@ -26,14 +26,12 @@ config BOOTCHARTD #define FOR_bootchartd #include "toys.h" -#include GLOBALS( char buf[32]; long smpl_period_usec; int proc_accounting; int is_login; - int got_signal; void *head; ) @@ -171,7 +169,7 @@ static void start_logging() acct("kernel_procs_acct"); } memset(TT.buf, 0, sizeof(TT.buf)); - while (--tcnt && !TT.got_signal) { + while (--tcnt && !toys.signal) { int i = 0, j = 0, fd = open("/proc/uptime", O_RDONLY); if (fd < 0) goto wait_usec; char *line = get_line(fd); @@ -250,11 +248,6 @@ static void stop_logging(char *tmp_dir, char *prog) } } -static void signal_handler(int sig) -{ - TT.got_signal = sig; -} - void bootchartd_main() { pid_t lgr_pid, self_pid = getpid(); @@ -291,7 +284,7 @@ void bootchartd_main() if (!(lgr_pid = fork())) { char *tmp_dir = create_tmp_dir(); - sigatexit(signal_handler); + sigatexit(generic_signal); raise(SIGSTOP); if (!bchartd_opt && !getenv("PATH")) putenv("PATH=/sbin:/usr/sbin:/bin:/usr/bin"); -- cgit v1.2.3