Jamie Guinan writes:
authorEric Andersen <andersen@codepoet.org>
Mon, 12 Apr 2004 17:59:24 +0000 (17:59 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 12 Apr 2004 17:59:24 +0000 (17:59 -0000)
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

init/init.c
shell/hush.c
shell/lash.c

index 159b539121a286fe926627c9a1438a482756064e..ae2fd4c3aafb707be02f9e4146adf0760df506d0 100644 (file)
@@ -53,7 +53,7 @@
 #endif
 
 
-#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_MMU__)
+#if defined(__UCLIBC__) && !defined(__ARCH_HAS_MMU__)
 #define fork   vfork
 #endif
 
@@ -913,7 +913,7 @@ static void check_memory(void)
        if (check_free_memory() > 1000)
                return;
 
-#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
        if (stat("/etc/fstab", &statBuf) == 0) {
                /* swapon -a requires /proc typically */
                new_init_action(SYSINIT, "/bin/mount -t proc proc /proc", "");
@@ -957,7 +957,7 @@ static void parse_inittab(void)
                new_init_action(CTRLALTDEL, "/sbin/reboot", "");
                /* Umount all filesystems on halt/reboot */
                new_init_action(SHUTDOWN, "/bin/umount -a -r", "");
-#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
                /* Swapoff on halt/reboot */
                new_init_action(SHUTDOWN, "/sbin/swapoff -a", "");
 #endif
index ad5ddf0d561c7cfa6d1aacc43bd203f5bf437f61..8f4cc9780f8795f6927bd3e523ac8363a78a9ade 100644 (file)
@@ -1439,7 +1439,7 @@ static int run_pipe_real(struct pipe *pi)
                }
 
                /* XXX test for failed fork()? */
-#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
                if (!(child->pid = fork()))
 #else
                if (!(child->pid = vfork()))
@@ -2258,7 +2258,7 @@ FILE *generate_stream_from_list(struct pipe *head)
 #if 1
        int pid, channel[2];
        if (pipe(channel)<0) bb_perror_msg_and_die("pipe");
-#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
        pid=fork();
 #else
        pid=vfork();
index b46cee80713ee61848184776155c905ead47974c..fa416c74261e635ce41250a69b0c44e15cd53966 100644 (file)
@@ -1380,7 +1380,7 @@ static int run_command(struct job *newjob, int inbg, int outpipe[2])
                        }
                }
 
-#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
                if (!(child->pid = fork()))
 #else
                if (!(child->pid = vfork()))