Skip to contentSkip to conversation

[4888] Do not disturb old fd flags (eg O_APPEND) when setting nonblock, by

Qemu-devel Thiemo Seufer 1 participant 1 message Jul 18, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 4888

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4888
Author:   ths
Date:     2008-07-18 16:34:43 +0000 (Fri, 18 Jul 2008)

Log Message:
-----------
Do not disturb old fd flags (eg O_APPEND) when setting nonblock, by Ian Jackson.

Modified Paths:
--------------
trunk/vl.c

Modified: trunk/vl.c
===================================================================

vl.c +3 -1
@@ -2141,7 +2141,9 @@
 
 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 */