From 49b701a6d1aff4269d6bcab3147db635c2a1cc24 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 6 May 2026 14:47:20 -0500 Subject: [PATCH] Remove redundant hfd initialization from run_lines() (because expand_redir() does it) and add to sh_main() (because subshell_setup() calls fpathopen() for script file). --- toys/pending/sh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/pending/sh.c b/toys/pending/sh.c index ef6cd3bd..520899cd 100644 --- a/toys/pending/sh.c +++ b/toys/pending/sh.c @@ -3939,7 +3939,6 @@ static void run_lines(void) s = *TT.ff->pl->arg->v; ss = TT.ff->pl->arg->v[1]; if (DEBUG) dprintf(2, "%d s=%s ss=%s ctl=%s type=%d pl=%p ff=%p\n", getpid(), (TT.ff->pl->type == 'F') ? ((struct sh_function *)s)->name : s, ss, ctl, TT.ff->pl->type, TT.ff->pl, TT.ff); - if (!pplist) TT.hfd = 10; if (TT.ff->pl->type<2) { // skip disabled blocks @@ -4501,6 +4500,7 @@ if (DEBUG) { dprintf(2, "%d main", getpid()); for (unsigned uu = 0; toys.argv[uu signify(SIGPIPE, 0); TT.options = (toys.optflags&0xff)|OPT_B; TT.pid = getpid(); + TT.hfd = 10; srandom(TT.SECONDS = millitime()); // TODO euid stuff? -- 2.39.5