Cut-n-paste strikes again
[oweals/busybox.git] / shell / lash.c
index b46cee80713ee61848184776155c905ead47974c..f454e699084beb1afda05b521a7a54d1c13c5451 100644 (file)
@@ -656,6 +656,7 @@ static int setup_redirects(struct child_prog *prog, int squirrel[])
                if (openfd != redir->fd) {
                        if (squirrel && redir->fd < 3) {
                                squirrel[redir->fd] = dup(redir->fd);
+                               fcntl (squirrel[redir->fd], F_SETFD, FD_CLOEXEC);
                        }
                        dup2(openfd, redir->fd);
                        close(openfd);
@@ -1380,7 +1381,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()))