Avoid problem if system doesn't define MSG_DONTWAIT

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25216 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-06-03 07:39:47 +00:00
parent e6350bd616
commit 9f67e8bf5e
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2007-06-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSHTTPURLHandle.m: define MSG_DONTWAIT as zero if it's not
defined ... it should not be needed anyway if the socket is already
non-blocking.
2007-06-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/win32/GSFileHandleWin32.m: Clean up indentation issues etc.

View file

@ -1281,6 +1281,9 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
int result;
unsigned char c;
#if !defined(MSG_DONTWAIT)
#define MSG_DONTWAIT 0
#endif
result = recv(fd, &c, 1, MSG_PEEK | MSG_DONTWAIT);
if (result == 0 || (result < 0 && errno != EAGAIN && errno != EINTR))
{