aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-10-10 14:38:47 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-10-10 14:38:47 +0000
commit82d38dab917754c9c37aaa7e414a47318b5082fe (patch)
treeea00ffed0879edb0f2dce87953d6f9c5908a18bf /applets
parent141750e38897900db98eaeab1ea35c18f5794023 (diff)
downloadbusybox-82d38dab917754c9c37aaa7e414a47318b5082fe.tar.gz
get rid of global "struct bb_applet *current_applet"
Diffstat (limited to 'applets')
-rw-r--r--applets/applets.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/applets/applets.c b/applets/applets.c
index 55f8e6b23..3b4f395c9 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -28,7 +28,6 @@
#endif
-const struct bb_applet *current_applet;
const char *applet_name;
#if !BB_MMU
bool re_execed;
@@ -507,7 +506,7 @@ static int busybox_main(char **argv)
bb_error_msg_and_die("applet not found");
}
-void run_current_applet_and_exit(char **argv)
+void run_appletstruct_and_exit(const struct bb_applet *applet, char **argv)
{
int argc = 1;
@@ -518,19 +517,19 @@ void run_current_applet_and_exit(char **argv)
optind = 1;
xfunc_error_retval = EXIT_FAILURE;
- applet_name = current_applet->name;
+ applet_name = applet->name;
if (argc == 2 && !strcmp(argv[1], "--help"))
bb_show_usage();
if (ENABLE_FEATURE_SUID)
- check_suid(current_applet);
- exit(current_applet->main(argc, argv));
+ check_suid(applet);
+ exit(applet->main(argc, argv));
}
void run_applet_and_exit(const char *name, char **argv)
{
- current_applet = find_applet_by_name(name);
- if (current_applet)
- run_current_applet_and_exit(argv);
+ const struct bb_applet *applet = find_applet_by_name(name);
+ if (applet)
+ run_appletstruct_and_exit(applet, argv);
if (!strncmp(name, "busybox", 7))
exit(busybox_main(argv));
}