From 7ae155398062be93c71116fcc757471d5a324ddf Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 30 May 2006 18:17:21 +0000 Subject: - consolidate "Sending SIG%s to all processes"; untested.. text data bss dec hex filename 5379 32 8 5419 152b init/init.o.oorig 5358 32 8 5398 1516 init/init.o --- init/init.c | 4 ++-- init/init_shared.c | 8 ++++---- init/init_shared.h | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/init/init.c b/init/init.c index b17ebc2ce..d072a2209 100644 --- a/init/init.c +++ b/init/init.c @@ -683,12 +683,12 @@ static void shutdown_system(void) sync(); /* Send signals to every process _except_ pid 1 */ - message(CONSOLE | LOG, "Sending SIGTERM to all processes."); + message(CONSOLE | LOG, init_sending_format, "TERM"); kill(-1, SIGTERM); sleep(1); sync(); - message(CONSOLE | LOG, "Sending SIGKILL to all processes."); + message(CONSOLE | LOG, init_sending_format, "KILL"); kill(-1, SIGKILL); sleep(1); diff --git a/init/init_shared.c b/init/init_shared.c index 6404da55a..190d0a33e 100644 --- a/init/init_shared.c +++ b/init/init_shared.c @@ -44,16 +44,16 @@ int bb_shutdown_system(unsigned long magic) sync(); /* Send signals to every process _except_ pid 1 */ - message = "Sending SIGTERM to all processes."; - syslog(pri, "%s", message); + message = "TERM"; + syslog(pri, init_sending_format, message); printf(bb_shutdown_format, message); kill(-1, SIGTERM); sleep(1); sync(); - message = "Sending SIGKILL to all processes."; - syslog(pri, "%s", message); + message = "KILL"; + syslog(pri, init_sending_format, message); printf(bb_shutdown_format, message); kill(-1, SIGKILL); diff --git a/init/init_shared.h b/init/init_shared.h index 1e4cfac98..4431a0324 100644 --- a/init/init_shared.h +++ b/init/init_shared.h @@ -1,3 +1,4 @@ extern int kill_init(int sig); extern int bb_shutdown_system(unsigned long magic); +const char * const init_sending_format = "Sending SIG%s to all processes."; -- cgit v1.2.3