aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index 613fa849d2..59e58a119a 100644
--- a/vl.c
+++ b/vl.c
@@ -2141,7 +2141,9 @@ static inline int send_all(int fd, const uint8_t *buf, int len1)
void socket_set_nonblock(int fd)
{
- fcntl(fd, F_SETFL, O_NONBLOCK);
+ int f;
+ f = fcntl(fd, F_GETFL);
+ fcntl(fd, F_SETFL, f | O_NONBLOCK);
}
#endif /* !_WIN32 */