You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "Frozen935 (via GitHub)" <gi...@apache.org> on 2026/01/21 12:46:58 UTC

[PR] nsh: fix nsh redirect fd double close [nuttx-apps]

Frozen935 opened a new pull request, #3364:
URL: https://github.com/apache/nuttx-apps/pull/3364

   avoid double-close of redirection fds
   
   *Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   Fix a double close() in foreground redirection. nsh_undirect() already closes the redirected fd_in/fd_out, but close_redir would close them again. Reset fd_in/fd_out to STDIN_FILENO/STDOUT_FILENO after nsh_undirect() to avoid closing the same fd twice.
   
   ## Impact
   
   *nsh_redirect.*
   
   ## Testing
   
   ```
   nsh> ls > /tmp/a.txt
   nsh> help
   nsh> cat /tmp/a.txt.
   ```
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] nsh: fix nsh redirect fd double close [nuttx-apps]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #3364:
URL: https://github.com/apache/nuttx-apps/pull/3364


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org