nsh: fix nsh redirect fd double close

avoid double-close of redirection fds

Signed-off-by: zhenwei fang <fangzhenwei@bytedance.com>
This commit is contained in:
zhenwei fang 2026-01-21 20:15:16 +08:00 committed by Alan C. Assis
parent 85b1a1c8c1
commit 72fe4e21e1

View file

@ -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;
}
}