From 468aea2d8800cc0496383616d82d7c957ae8bc50 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 1 Apr 2008 14:47:57 +0000 Subject: shells: do not frocibly enable test, echo and kill _applets_, just build relevant source and use xxx_main functions. build system: add a special case when we have exactly one applet enabled (makes "true", "false", "basename" REALLY tiny). getopt32: do not use stdio. function old new delta getopt32 1385 1412 +27 make_device 1187 1200 +13 basename_main 120 127 +7 tcpudpsvd_main 1922 1926 +4 testcmd 5 - -5 echocmd 5 - -5 fuser_main 1243 1231 -12 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 4/1 up/down: 51/-22) Total: 29 bytes --- libbb/error_msg_and_die.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'libbb/error_msg_and_die.c') diff --git a/libbb/error_msg_and_die.c b/libbb/error_msg_and_die.c index 0e99a03..addd818 100644 --- a/libbb/error_msg_and_die.c +++ b/libbb/error_msg_and_die.c @@ -9,33 +9,6 @@ #include "libbb.h" -int die_sleep; -#if ENABLE_FEATURE_PREFER_APPLETS || ENABLE_HUSH -jmp_buf die_jmp; -#endif - -void xfunc_die(void) -{ - if (die_sleep) { - if ((ENABLE_FEATURE_PREFER_APPLETS || ENABLE_HUSH) - && die_sleep < 0 - ) { - /* Special case. We arrive here if NOFORK applet - * calls xfunc, which then decides to die. - * We don't die, but jump instead back to caller. - * NOFORK applets still cannot carelessly call xfuncs: - * p = xmalloc(10); - * q = xmalloc(10); // BUG! if this dies, we leak p! - */ - /* -2222 means "zero" (longjmp can't pass 0) - * run_nofork_applet() catches -2222. */ - longjmp(die_jmp, xfunc_error_retval ? xfunc_error_retval : -2222); - } - sleep(die_sleep); - } - exit(xfunc_error_retval); -} - void bb_error_msg_and_die(const char *s, ...) { va_list p; -- cgit v1.1