bb_full_fd_action: remove potential xmalloc from NOFORK path
[oweals/busybox.git] / shell / lash.c
index aba9c0a2e1f14b05f07417b0f3c1fc3be57af498..c72a65639a5f0a09b874947c513c970bb58a8ad0 100644 (file)
@@ -571,11 +571,10 @@ static int setup_redirects(struct child_prog *prog, int squirrel[])
                        break;
                }
 
-               openfd = open(redir->filename, mode, 0666);
+               openfd = open3_or_warn(redir->filename, mode, 0666);
                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!) */
-                       bb_perror_msg("error opening %s", redir->filename);
                        return 1;
                }