#include <getopt.h>
#include <glob.h>
-#include "busybox.h" /* for struct bb_applet */
+#include "libbb.h"
#define expand_t glob_t
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!) */
}
#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);