summaryrefslogtreecommitdiff
path: root/libbb/vfork_daemon_rexec.c
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 /libbb/vfork_daemon_rexec.c
parent141750e38897900db98eaeab1ea35c18f5794023 (diff)
downloadbusybox-w32-82d38dab917754c9c37aaa7e414a47318b5082fe.tar.gz
busybox-w32-82d38dab917754c9c37aaa7e414a47318b5082fe.tar.bz2
busybox-w32-82d38dab917754c9c37aaa7e414a47318b5082fe.zip
get rid of global "struct bb_applet *current_applet"
Diffstat (limited to 'libbb/vfork_daemon_rexec.c')
-rw-r--r--libbb/vfork_daemon_rexec.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 80c72f165..a01065d69 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -104,7 +104,7 @@ int wait_pid(int *wstat, int pid)
104void save_nofork_data(struct nofork_save_area *save) 104void save_nofork_data(struct nofork_save_area *save)
105{ 105{
106 memcpy(&save->die_jmp, &die_jmp, sizeof(die_jmp)); 106 memcpy(&save->die_jmp, &die_jmp, sizeof(die_jmp));
107 save->current_applet = current_applet; 107 save->applet_name = applet_name;
108 save->xfunc_error_retval = xfunc_error_retval; 108 save->xfunc_error_retval = xfunc_error_retval;
109 save->option_mask32 = option_mask32; 109 save->option_mask32 = option_mask32;
110 save->die_sleep = die_sleep; 110 save->die_sleep = die_sleep;
@@ -114,19 +114,16 @@ void save_nofork_data(struct nofork_save_area *save)
114void restore_nofork_data(struct nofork_save_area *save) 114void restore_nofork_data(struct nofork_save_area *save)
115{ 115{
116 memcpy(&die_jmp, &save->die_jmp, sizeof(die_jmp)); 116 memcpy(&die_jmp, &save->die_jmp, sizeof(die_jmp));
117 current_applet = save->current_applet; 117 applet_name = save->applet_name;
118 xfunc_error_retval = save->xfunc_error_retval; 118 xfunc_error_retval = save->xfunc_error_retval;
119 option_mask32 = save->option_mask32; 119 option_mask32 = save->option_mask32;
120 die_sleep = save->die_sleep; 120 die_sleep = save->die_sleep;
121
122 applet_name = current_applet->name;
123} 121}
124 122
125int run_nofork_applet_prime(struct nofork_save_area *old, const struct bb_applet *a, char **argv) 123int run_nofork_applet_prime(struct nofork_save_area *old, const struct bb_applet *a, char **argv)
126{ 124{
127 int rc, argc; 125 int rc, argc;
128 126
129 current_applet = a;
130 applet_name = a->name; 127 applet_name = a->name;
131 xfunc_error_retval = EXIT_FAILURE; 128 xfunc_error_retval = EXIT_FAILURE;
132 /*option_mask32 = 0; - not needed */ 129 /*option_mask32 = 0; - not needed */
@@ -193,8 +190,7 @@ int spawn_and_wait(char **argv)
193 return wait4pid(rc); 190 return wait4pid(rc);
194 /* child */ 191 /* child */
195 xfunc_error_retval = EXIT_FAILURE; 192 xfunc_error_retval = EXIT_FAILURE;
196 current_applet = a; 193 run_appletstruct_and_exit(a, argv);
197 run_current_applet_and_exit(argv);
198#endif 194#endif
199 } 195 }
200#endif /* FEATURE_PREFER_APPLETS */ 196#endif /* FEATURE_PREFER_APPLETS */