aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-18 16:34:43 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-18 16:34:43 +0000
commitfd58ff9dc7bcb5a795eca12e8d8ccd467f54df50 (patch)
treea8bcc4a44b0ea81d4d1d093e2cf11a5d645bb2a2 /vl.c
parent8d7d8c4bb10ffeb6c875a821a2ad842b8eb09070 (diff)
Do not disturb old fd flags (eg O_APPEND) when setting nonblock, by
Ian Jackson. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4888 c046a42c-6fe2-441c-8c8c-71466251a162
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 */