summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c6
-rw-r--r--shell/hush.c11
-rw-r--r--shell/lash.c7
3 files changed, 21 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index ffafcfe..0c89399 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6756,7 +6756,11 @@ forkshell(struct job *jp, const union node *n, int mode)
TRACE(("forkshell(%%%d, 0x%lx, %d) called\n", jp - jobtab, (long)n,
mode));
INTOFF;
+#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
pid = fork();
+#else
+ pid = vfork();
+#endif
if (pid == -1) {
TRACE(("Fork failed, errno=%d\n", errno));
INTON;
@@ -12627,7 +12631,7 @@ findvar(struct var **vpp, const char *name)
/*
* Copyright (c) 1999 Herbert Xu <herbert@debian.org>
* This file contains code for the times builtin.
- * $Id: ash.c,v 1.31 2001/10/24 17:19:35 andersen Exp $
+ * $Id: ash.c,v 1.32 2001/10/28 05:12:18 andersen Exp $
*/
static int timescmd (int argc, char **argv)
{
diff --git a/shell/hush.c b/shell/hush.c
index d37842b..1950138 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -1403,7 +1403,12 @@ static int run_pipe_real(struct pipe *pi)
}
/* XXX test for failed fork()? */
- if (!(child->pid = fork())) {
+#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
+ if (!(child->pid = fork()))
+#else
+ if (!(child->pid = vfork()))
+#endif
+ {
/* Set the handling for job control signals back to the default. */
signal(SIGINT, SIG_DFL);
signal(SIGQUIT, SIG_DFL);
@@ -2118,7 +2123,11 @@ FILE *generate_stream_from_list(struct pipe *head)
#if 1
int pid, channel[2];
if (pipe(channel)<0) perror_msg_and_die("pipe");
+#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
pid=fork();
+#else
+ pid=vfork();
+#endif
if (pid<0) {
perror_msg_and_die("fork");
} else if (pid==0) {
diff --git a/shell/lash.c b/shell/lash.c
index 004d949..5b9d0a6 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -1347,7 +1347,12 @@ static int run_command(struct job *newjob, int inbg, int outpipe[2])
}
}
- if (!(child->pid = fork())) {
+#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
+ if (!(child->pid = fork()))
+#else
+ if (!(child->pid = vfork()))
+#endif
+ {
/* Set the handling for job control signals back to the default. */
signal(SIGINT, SIG_DFL);
signal(SIGQUIT, SIG_DFL);