fix trex-277
authorHanoh Haim <[email protected]>
Sun, 27 Nov 2016 15:33:38 +0000 (17:33 +0200)
committerHanoh Haim <[email protected]>
Mon, 28 Nov 2016 19:16:09 +0000 (21:16 +0200)
Signed-off-by: Hanoh Haim <[email protected]>
src/utl_term_io.cpp

index 8e56118..e45aeeb 100755 (executable)
@@ -78,6 +78,13 @@ int utl_termio_init(){
     atexit(exit_handler1);
     save_termio();
     set_conio_terminal_mode();
+
+    /* stdout is non-blocking */
+    int fd = fileno(stdout);
+    int f = fcntl(fd, F_GETFL, 0);
+    f |= O_NONBLOCK;
+    fcntl(fd, F_SETFL, f);
+
     return (0);
 }