aboutsummaryrefslogtreecommitdiff
path: root/init/init.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-10-09 16:42:57 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-10-09 16:42:57 +0200
commit550bf5b4a418378cd8f9fbbf5252fe57acdacb5a (patch)
tree7ed13e04cf415be6830363953220d7cffd4580b8 /init/init.c
parent4cd99e7c6c1af77721b890ed5ae26d747796c4bd (diff)
downloadbusybox-w32-550bf5b4a418378cd8f9fbbf5252fe57acdacb5a.tar.gz
busybox-w32-550bf5b4a418378cd8f9fbbf5252fe57acdacb5a.tar.bz2
busybox-w32-550bf5b4a418378cd8f9fbbf5252fe57acdacb5a.zip
remove global "jmp_buf die_jmp" from !FEATURE_PREFER_APPLETS builds
function old new delta xfunc_has_died - 21 +21 sleep_much - 12 +12 sleep10 - 9 +9 die_func - 4 +4 fflush_stdout_and_exit 35 36 +1 builtin_type 121 119 -2 die_sleep 4 - -4 xfunc_die 60 24 -36 hush_main 1128 1011 -117 die_jmp 156 - -156 ------------------------------------------------------------------------------ (add/remove: 4/2 grow/shrink: 1/3 up/down: 47/-315) Total: -268 bytes text data bss dec hex filename 939992 992 17652 958636 ea0ac busybox_old 939880 992 17496 958368 e9fa0 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'init/init.c')
-rw-r--r--init/init.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c
index b2fe85635..80c5d0f74 100644
--- a/init/init.c
+++ b/init/init.c
@@ -1015,6 +1015,11 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
1015} 1015}
1016#endif 1016#endif
1017 1017
1018static void sleep_much(void)
1019{
1020 sleep(30 * 24*60*60);
1021}
1022
1018int init_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 1023int init_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
1019int init_main(int argc UNUSED_PARAM, char **argv) 1024int init_main(int argc UNUSED_PARAM, char **argv)
1020{ 1025{
@@ -1051,12 +1056,12 @@ int init_main(int argc UNUSED_PARAM, char **argv)
1051 1056
1052 /* If, say, xmalloc would ever die, we don't want to oops kernel 1057 /* If, say, xmalloc would ever die, we don't want to oops kernel
1053 * by exiting. 1058 * by exiting.
1054 * NB: we set die_sleep *after* PID 1 check and bb_show_usage. 1059 * NB: we set die_func *after* PID 1 check and bb_show_usage.
1055 * Otherwise, for example, "init u" ("please rexec yourself" 1060 * Otherwise, for example, "init u" ("please rexec yourself"
1056 * command for sysvinit) will show help text (which isn't too bad), 1061 * command for sysvinit) will show help text (which isn't too bad),
1057 * *and sleep forever* (which is bad!) 1062 * *and sleep forever* (which is bad!)
1058 */ 1063 */
1059 die_sleep = 30 * 24*60*60; 1064 die_func = sleep_much;
1060 1065
1061 /* Figure out where the default console should be */ 1066 /* Figure out where the default console should be */
1062 console_init(); 1067 console_init();