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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to