mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
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
This commit is contained in:
parent
8d7d8c4bb1
commit
fd58ff9dc7
1 changed files with 3 additions and 1 deletions
4
vl.c
4
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 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue