Skip to content

Commit

Permalink
Fix truncation (partial write) of output to foreground STDOUT
Browse files Browse the repository at this point in the history
Found by: michaelortmann
Patch by: michaelortmann
Fixes: #665
  • Loading branch information
michaelortmann authored and vanosg committed Oct 14, 2018
1 parent 113a7ab commit d66d0c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/net.c
Expand Up @@ -366,7 +366,8 @@ void setsock(int sock, int options)
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &parm, sizeof(int));
}
/* Yay async i/o ! */
fcntl(sock, F_SETFL, O_NONBLOCK);
if ((sock != STDOUT) || backgrd)
fcntl(sock, F_SETFL, O_NONBLOCK);
}

int getsock(int af, int options)
Expand Down

0 comments on commit d66d0c0

Please sign in to comment.