aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-04-12 17:59:24 +0000
committerEric Andersen <andersen@codepoet.org>2004-04-12 17:59:24 +0000
commite3efc9230c2f192e2738cee733c6d4fa20a2be2a (patch)
tree4f31c690a602713220868b2d6f98bf4aaf53eeed
parenta08345598d7c6d428db30cdcf8e5e7d317362da0 (diff)
downloadbusybox-w32-e3efc9230c2f192e2738cee733c6d4fa20a2be2a.tar.gz
busybox-w32-e3efc9230c2f192e2738cee733c6d4fa20a2be2a.tar.bz2
busybox-w32-e3efc9230c2f192e2738cee733c6d4fa20a2be2a.zip
Jamie Guinan writes:
It looks like latest uClibc defines ARCH_HAS_MMU, but a few busybox files test UCLIBC_HAS_MMU, resulting in vfork() getting called instead of fork(), etc. Patch below. Only tested for lash. Cheers, -Jamie
-rw-r--r--init/init.c6
-rw-r--r--shell/hush.c4
-rw-r--r--shell/lash.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/init/init.c b/init/init.c
index 159b53912..ae2fd4c3a 100644
--- a/init/init.c
+++ b/init/init.c
@@ -53,7 +53,7 @@
53#endif 53#endif
54 54
55 55
56#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_MMU__) 56#if defined(__UCLIBC__) && !defined(__ARCH_HAS_MMU__)
57#define fork vfork 57#define fork vfork
58#endif 58#endif
59 59
@@ -913,7 +913,7 @@ static void check_memory(void)
913 if (check_free_memory() > 1000) 913 if (check_free_memory() > 1000)
914 return; 914 return;
915 915
916#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) 916#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
917 if (stat("/etc/fstab", &statBuf) == 0) { 917 if (stat("/etc/fstab", &statBuf) == 0) {
918 /* swapon -a requires /proc typically */ 918 /* swapon -a requires /proc typically */
919 new_init_action(SYSINIT, "/bin/mount -t proc proc /proc", ""); 919 new_init_action(SYSINIT, "/bin/mount -t proc proc /proc", "");
@@ -957,7 +957,7 @@ static void parse_inittab(void)
957 new_init_action(CTRLALTDEL, "/sbin/reboot", ""); 957 new_init_action(CTRLALTDEL, "/sbin/reboot", "");
958 /* Umount all filesystems on halt/reboot */ 958 /* Umount all filesystems on halt/reboot */
959 new_init_action(SHUTDOWN, "/bin/umount -a -r", ""); 959 new_init_action(SHUTDOWN, "/bin/umount -a -r", "");
960#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) 960#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
961 /* Swapoff on halt/reboot */ 961 /* Swapoff on halt/reboot */
962 new_init_action(SHUTDOWN, "/sbin/swapoff -a", ""); 962 new_init_action(SHUTDOWN, "/sbin/swapoff -a", "");
963#endif 963#endif
diff --git a/shell/hush.c b/shell/hush.c
index ad5ddf0d5..8f4cc9780 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -1439,7 +1439,7 @@ static int run_pipe_real(struct pipe *pi)
1439 } 1439 }
1440 1440
1441 /* XXX test for failed fork()? */ 1441 /* XXX test for failed fork()? */
1442#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) 1442#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
1443 if (!(child->pid = fork())) 1443 if (!(child->pid = fork()))
1444#else 1444#else
1445 if (!(child->pid = vfork())) 1445 if (!(child->pid = vfork()))
@@ -2258,7 +2258,7 @@ FILE *generate_stream_from_list(struct pipe *head)
2258#if 1 2258#if 1
2259 int pid, channel[2]; 2259 int pid, channel[2];
2260 if (pipe(channel)<0) bb_perror_msg_and_die("pipe"); 2260 if (pipe(channel)<0) bb_perror_msg_and_die("pipe");
2261#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) 2261#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
2262 pid=fork(); 2262 pid=fork();
2263#else 2263#else
2264 pid=vfork(); 2264 pid=vfork();
diff --git a/shell/lash.c b/shell/lash.c
index b46cee807..fa416c742 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -1380,7 +1380,7 @@ static int run_command(struct job *newjob, int inbg, int outpipe[2])
1380 } 1380 }
1381 } 1381 }
1382 1382
1383#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) 1383#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
1384 if (!(child->pid = fork())) 1384 if (!(child->pid = fork()))
1385#else 1385#else
1386 if (!(child->pid = vfork())) 1386 if (!(child->pid = vfork()))