From 51f547e3f0e0cf0f89383f5eb6287388532e12d4 Mon Sep 17 00:00:00 2001 From: zhenwei fang Date: Wed, 21 Jan 2026 20:15:16 +0800 Subject: [PATCH] nsh: fix nsh redirect fd double close avoid double-close of redirection fds Signed-off-by: zhenwei fang --- nshlib/nsh_parse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index 9b7b371afdb..9b1bde87538 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -726,6 +726,8 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, if (vtbl->np.np_redir_out || vtbl->np.np_redir_in) { nsh_undirect(vtbl, save); + fd_out = -1; + fd_in = -1; } }