aboutsummaryrefslogtreecommitdiff
path: root/libbb/vfork_daemon_rexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/vfork_daemon_rexec.c')
-rw-r--r--libbb/vfork_daemon_rexec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 2055c4b71..dad50ddb9 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -171,6 +171,7 @@ void FAST_FUNC run_noexec_applet_and_exit(int a, const char *name, char **argv)
171 * Higher-level code, hiding optional NOFORK/NOEXEC trickery. 171 * Higher-level code, hiding optional NOFORK/NOEXEC trickery.
172 */ 172 */
173 173
174#if !ENABLE_PLATFORM_MINGW32
174/* This does a fork/exec in one call, using vfork(). Returns PID of new child, 175/* This does a fork/exec in one call, using vfork(). Returns PID of new child,
175 * -1 for failure. Runs argv[0], searching path if that has no / in it. */ 176 * -1 for failure. Runs argv[0], searching path if that has no / in it. */
176pid_t FAST_FUNC spawn(char **argv) 177pid_t FAST_FUNC spawn(char **argv)
@@ -212,6 +213,7 @@ pid_t FAST_FUNC spawn(char **argv)
212 } 213 }
213 return pid; 214 return pid;
214} 215}
216#endif
215 217
216/* Die with an error message if we can't spawn a child process. */ 218/* Die with an error message if we can't spawn a child process. */
217pid_t FAST_FUNC xspawn(char **argv) 219pid_t FAST_FUNC xspawn(char **argv)
@@ -232,6 +234,7 @@ int FAST_FUNC spawn_and_wait(char **argv)
232 if (APPLET_IS_NOFORK(a)) 234 if (APPLET_IS_NOFORK(a))
233 return run_nofork_applet(a, argv); 235 return run_nofork_applet(a, argv);
234# if BB_MMU /* NOEXEC needs fork(), thus this is done only on MMU machines: */ 236# if BB_MMU /* NOEXEC needs fork(), thus this is done only on MMU machines: */
237# if !ENABLE_PLATFORM_MINGW32 /* and then only if not on Microsoft Windows */
235 if (APPLET_IS_NOEXEC(a)) { 238 if (APPLET_IS_NOEXEC(a)) {
236 fflush_all(); 239 fflush_all();
237 rc = fork(); 240 rc = fork();
@@ -241,6 +244,7 @@ int FAST_FUNC spawn_and_wait(char **argv)
241 /* child */ 244 /* child */
242 run_noexec_applet_and_exit(a, argv[0], argv); 245 run_noexec_applet_and_exit(a, argv[0], argv);
243 } 246 }
247# endif
244# endif 248# endif
245 } 249 }
246#endif 250#endif
@@ -248,6 +252,7 @@ int FAST_FUNC spawn_and_wait(char **argv)
248 return wait4pid(rc); 252 return wait4pid(rc);
249} 253}
250 254
255#if !ENABLE_PLATFORM_MINGW32
251#if !BB_MMU 256#if !BB_MMU
252void FAST_FUNC re_exec(char **argv) 257void FAST_FUNC re_exec(char **argv)
253{ 258{
@@ -340,3 +345,4 @@ void FAST_FUNC bb_sanitize_stdio(void)
340{ 345{
341 bb_daemonize_or_rexec(DAEMON_ONLY_SANITIZE, NULL); 346 bb_daemonize_or_rexec(DAEMON_ONLY_SANITIZE, NULL);
342} 347}
348#endif /* !MINGW32 */