xiaoxiang781216 opened a new pull request #1997:
URL: https://github.com/apache/incubator-nuttx/pull/1997


   ## Summary
   since it is wrong to close the builtin stream and specially note
   https://pubs.opengroup.org/onlinepubs/9699919799/functions/fclose.html:
   
   Since after the call to fclose() any use of stream results in
   undefined behavior, fclose() should not be used on stdin, stdout,
   or stderr except immediately before process termination (see XBD
   Process Termination), so as to avoid triggering undefined behavior
   in other standard interfaces that rely on these streams. If there
   are any atexit() handlers registered by the application, such a
   call to fclose() should not occur until the last handler is
   finishing. Once fclose() has been used to close stdin, stdout, or
   stderr, there is no standard way to reopen any of these streams.
   
   and it is also unnecessary because the stream always get flushed.
   
   ## Impact
   Remove the undefined behaviour
   
   ## Testing
   reported here:
   b079726
   


----------------------------------------------------------------
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.

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


Reply via email to