This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 72fe4e21e nsh: fix nsh redirect fd double close
72fe4e21e is described below
commit 72fe4e21e1e2d715aedf23cd1c50adf105fff99f
Author: zhenwei fang <[email protected]>
AuthorDate: Wed Jan 21 20:15:16 2026 +0800
nsh: fix nsh redirect fd double close
avoid double-close of redirection fds
Signed-off-by: zhenwei fang <[email protected]>
---
nshlib/nsh_parse.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c
index 9b7b371af..9b1bde875 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;
}
}