hush: add support for ':'; create testsuite entries
[oweals/busybox.git] / shell / lash_unused.c
index 781dfdb5aac0381cb38810947ae8a1fb466adb24..d57f584b200c371c27218dde4a711e46de85c097 100644 (file)
@@ -23,7 +23,7 @@
 #include <getopt.h>
 #include <glob.h>
 
-#include "busybox.h" /* for struct bb_applet */
+#include "libbb.h"
 
 #define expand_t       glob_t
 
@@ -566,7 +566,7 @@ static int setup_redirects(struct child_prog *prog, int squirrel[])
                        break;
                }
 
-               openfd = open3_or_warn(redir->filename, mode, 0666);
+               openfd = open_or_warn(redir->filename, mode);
                if (openfd < 0) {
                        /* this could get lost if stderr has been redirected, but
                           bash and ash both lose it as well (though zsh doesn't!) */
@@ -1253,8 +1253,8 @@ static int run_command(struct job *newjob, int inbg, int outpipe[2])
                        }
 #if ENABLE_FEATURE_SH_STANDALONE
                        {
-                               const struct bb_applet *a = find_applet_by_name(child->argv[i]);
-                               if (a && a->nofork) {
+                               int a = find_applet_by_name(child->argv[i]);
+                               if (a >= 0 && APPLET_IS_NOFORK(a)) {
                                        setup_redirects(child, squirrel);
                                        rcode = run_nofork_applet(a, child->argv + i);
                                        restore_redirects(squirrel);