You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/10/15 13:36:45 UTC

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #425: Remove all fclose with stdin, stdout and stderr

patacongo commented on a change in pull request #425:
URL: https://github.com/apache/incubator-nuttx-apps/pull/425#discussion_r505547525



##########
File path: graphics/nxwm/src/cnxterm.cxx
##########
@@ -500,27 +500,18 @@ int CNxTerm::nxterm(int argc, char *argv[])
   // console).  (2) Don't bother trying to put debug instrumentation in the
   // following because it will end up in the NxTerm window.
 
-  std::fflush(stdout);
-  std::fflush(stderr);
-
 #ifdef CONFIG_NXTERM_NXKBDIN
-  std::fclose(stdin);
+  std::fflush(stdin);

Review comment:
       Using fflush with stdin is not appropriate.  fflush has no effect on input streams.  See https://pubs.opengroup.org/onlinepubs/007904975/functions/fflush.html
   
   It would be better to remove this and all other places where fflush is used with stdin.




----------------------------------------------------------------
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:
users@infra.apache.org