diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-10-28 05:12:20 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-10-28 05:12:20 +0000 |
commit | 79362aa78e62f5d1539b61ac300328c7235b1f0b (patch) | |
tree | 5dbf1995f603a95960c0ef94558954091ce7beef /shell | |
parent | b71780b77e18183cdb25fc9402a786370bc7dbd6 (diff) | |
download | busybox-w32-79362aa78e62f5d1539b61ac300328c7235b1f0b.tar.gz busybox-w32-79362aa78e62f5d1539b61ac300328c7235b1f0b.tar.bz2 busybox-w32-79362aa78e62f5d1539b61ac300328c7235b1f0b.zip |
Add in some (theoretical) uClinux support. Some init cleanups
git-svn-id: svn://busybox.net/trunk/busybox@3596 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 6 | ||||
-rw-r--r-- | shell/hush.c | 11 | ||||
-rw-r--r-- | shell/lash.c | 7 |
3 files changed, 21 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index ffafcfeb4..0c893998d 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -6756,7 +6756,11 @@ forkshell(struct job *jp, const union node *n, int mode) | |||
6756 | TRACE(("forkshell(%%%d, 0x%lx, %d) called\n", jp - jobtab, (long)n, | 6756 | TRACE(("forkshell(%%%d, 0x%lx, %d) called\n", jp - jobtab, (long)n, |
6757 | mode)); | 6757 | mode)); |
6758 | INTOFF; | 6758 | INTOFF; |
6759 | #if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) | ||
6759 | pid = fork(); | 6760 | pid = fork(); |
6761 | #else | ||
6762 | pid = vfork(); | ||
6763 | #endif | ||
6760 | if (pid == -1) { | 6764 | if (pid == -1) { |
6761 | TRACE(("Fork failed, errno=%d\n", errno)); | 6765 | TRACE(("Fork failed, errno=%d\n", errno)); |
6762 | INTON; | 6766 | INTON; |
@@ -12627,7 +12631,7 @@ findvar(struct var **vpp, const char *name) | |||
12627 | /* | 12631 | /* |
12628 | * Copyright (c) 1999 Herbert Xu <herbert@debian.org> | 12632 | * Copyright (c) 1999 Herbert Xu <herbert@debian.org> |
12629 | * This file contains code for the times builtin. | 12633 | * This file contains code for the times builtin. |
12630 | * $Id: ash.c,v 1.31 2001/10/24 17:19:35 andersen Exp $ | 12634 | * $Id: ash.c,v 1.32 2001/10/28 05:12:18 andersen Exp $ |
12631 | */ | 12635 | */ |
12632 | static int timescmd (int argc, char **argv) | 12636 | static int timescmd (int argc, char **argv) |
12633 | { | 12637 | { |
diff --git a/shell/hush.c b/shell/hush.c index d37842b79..195013869 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1403,7 +1403,12 @@ static int run_pipe_real(struct pipe *pi) | |||
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | /* XXX test for failed fork()? */ | 1405 | /* XXX test for failed fork()? */ |
1406 | if (!(child->pid = fork())) { | 1406 | #if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) |
1407 | if (!(child->pid = fork())) | ||
1408 | #else | ||
1409 | if (!(child->pid = vfork())) | ||
1410 | #endif | ||
1411 | { | ||
1407 | /* Set the handling for job control signals back to the default. */ | 1412 | /* Set the handling for job control signals back to the default. */ |
1408 | signal(SIGINT, SIG_DFL); | 1413 | signal(SIGINT, SIG_DFL); |
1409 | signal(SIGQUIT, SIG_DFL); | 1414 | signal(SIGQUIT, SIG_DFL); |
@@ -2118,7 +2123,11 @@ FILE *generate_stream_from_list(struct pipe *head) | |||
2118 | #if 1 | 2123 | #if 1 |
2119 | int pid, channel[2]; | 2124 | int pid, channel[2]; |
2120 | if (pipe(channel)<0) perror_msg_and_die("pipe"); | 2125 | if (pipe(channel)<0) perror_msg_and_die("pipe"); |
2126 | #if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) | ||
2121 | pid=fork(); | 2127 | pid=fork(); |
2128 | #else | ||
2129 | pid=vfork(); | ||
2130 | #endif | ||
2122 | if (pid<0) { | 2131 | if (pid<0) { |
2123 | perror_msg_and_die("fork"); | 2132 | perror_msg_and_die("fork"); |
2124 | } else if (pid==0) { | 2133 | } else if (pid==0) { |
diff --git a/shell/lash.c b/shell/lash.c index 004d9495a..5b9d0a6b3 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]) | |||
1347 | } | 1347 | } |
1348 | } | 1348 | } |
1349 | 1349 | ||
1350 | if (!(child->pid = fork())) { | 1350 | #if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) |
1351 | if (!(child->pid = fork())) | ||
1352 | #else | ||
1353 | if (!(child->pid = vfork())) | ||
1354 | #endif | ||
1355 | { | ||
1351 | /* Set the handling for job control signals back to the default. */ | 1356 | /* Set the handling for job control signals back to the default. */ |
1352 | signal(SIGINT, SIG_DFL); | 1357 | signal(SIGINT, SIG_DFL); |
1353 | signal(SIGQUIT, SIG_DFL); | 1358 | signal(SIGQUIT, SIG_DFL); |