aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-12 12:27:32 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-12 12:27:32 +0000
commit5ce9987c2025ffb8eb0b57fed05744f9d94e9111 (patch)
tree4f3efe440c2db9df016a1aa3dc8d36eb89eb7a2a /applets
parent9befed76909bfe7cbda8fdf154c1a10a12e88006 (diff)
downloadbusybox-w32-5ce9987c2025ffb8eb0b57fed05744f9d94e9111.tar.gz
busybox-w32-5ce9987c2025ffb8eb0b57fed05744f9d94e9111.tar.bz2
busybox-w32-5ce9987c2025ffb8eb0b57fed05744f9d94e9111.zip
pass a copy of argv[i] to NOFORK applets (they may permute it etc).
set/save/restore more shared global variables whan call one applet from another git-svn-id: svn://busybox.net/trunk/busybox@18415 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'applets')
-rw-r--r--applets/applets.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/applets/applets.c b/applets/applets.c
index bbb545a84..82a7eeea1 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -33,7 +33,7 @@
33 33
34#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE 34#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
35/* Define usage_messages[] */ 35/* Define usage_messages[] */
36static const char usage_messages[] = 36static const char usage_messages[] = ""
37#define MAKE_USAGE 37#define MAKE_USAGE
38#include "usage.h" 38#include "usage.h"
39#include "applets.h" 39#include "applets.h"
@@ -590,6 +590,10 @@ static int busybox_main(int argc, char **argv)
590 590
591void run_current_applet_and_exit(int argc, char **argv) 591void run_current_applet_and_exit(int argc, char **argv)
592{ 592{
593 /* Reinit some shared global data */
594 optind = 1;
595 xfunc_error_retval = EXIT_FAILURE;
596
593 applet_name = current_applet->name; 597 applet_name = current_applet->name;
594 if (argc == 2 && !strcmp(argv[1], "--help")) 598 if (argc == 2 && !strcmp(argv[1], "--help"))
595 bb_show_usage(); 599 bb_show_usage();