diff options
author | Mark Doliner <markdoliner@pidgin.im> | 2007-10-14 09:57:32 +0000 |
---|---|---|
committer | Mark Doliner <markdoliner@pidgin.im> | 2007-10-14 09:57:32 +0000 |
commit | 4dea5d1b089300c1fe906e17291710ed9ce6445a (patch) | |
tree | 5176c1642f85994d89d66eebb89ab6142a0ead68 /libpurple/win32/libc_internal.h | |
parent | b28ce306c60195fc2b70dddcd9eb19019ceaa8b6 (diff) | |
download | pidgin-4dea5d1b089300c1fe906e17291710ed9ce6445a.tar.gz |
Fix all our calls to fcntl(listenfd, F_SETFL, O_NONBLOCK);
fcntl() with F_SETFL overwrites the old flags with the new ones, so
you should call fcntl() with F_GETFL, then OR that value with
O_NONBLOCK before setting the flags. We've been doing this
wrong for a long time and it hasn't seemed to hurt anything,
but I thought it would be good to fix it.
Diffstat (limited to 'libpurple/win32/libc_internal.h')
-rw-r--r-- | libpurple/win32/libc_internal.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libpurple/win32/libc_internal.h b/libpurple/win32/libc_internal.h index 9138d5808a..1902974032 100644 --- a/libpurple/win32/libc_internal.h +++ b/libpurple/win32/libc_internal.h @@ -49,9 +49,10 @@ struct hostent* wpurple_gethostbyname(const char *name); char* wpurple_strerror( int errornum ); /* fcntl.h */ -int wpurple_fcntl(int socket, int command, int val); -#define F_SETFL 1 -#define O_NONBLOCK 1 +int wpurple_fcntl(int socket, int command, ...); +#define F_GETFL 3 +#define F_SETFL 4 +#define O_NONBLOCK 04000 /* sys/ioctl.h */ #define SIOCGIFCONF 0x8912 /* get iface list */ |