From 15cb4a42724e480734157a55921ba435ed1413fc Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 11 Oct 2007 10:06:26 +0000 Subject: fix a problem with two different applet_name's --- libbb/appletlib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libbb/appletlib.c') diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 953f1e7e5..8b1ed8000 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -127,11 +127,12 @@ const struct bb_applet *find_applet_by_name(const char *name) int *const bb_errno __attribute__ ((section (".data"))); #endif -void lbb_prepare(char **argv) +void lbb_prepare(const char *applet, char **argv) { #ifdef __GLIBC__ (*(int **)&bb_errno) = __errno_location(); #endif + applet_name = applet; /* Set locale for everybody except 'init' */ if (ENABLE_LOCALE_SUPPORT && getpid() != 1) @@ -666,7 +667,7 @@ int lbb_main(int argc, char **argv) int main(int argc, char **argv) #endif { - lbb_prepare(argv); + lbb_prepare("busybox", argv); #if !BB_MMU /* NOMMU re-exec trick sets high-order bit in first byte of name */ -- cgit v1.2.3