Handle EAGAIN as EWOULDBLOCK, giving proper BSD sockets compatability.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2422 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2006-10-22 17:16:43 +00:00
parent af5348a8f2
commit 4006d79532
3 changed files with 6 additions and 2 deletions

View File

@ -32,7 +32,7 @@ void NET_SendPacket(cluster_t *cluster, SOCKET sock, int length, char *data, net
if (ret < 0)
{
int er = qerrno;
if (er == EWOULDBLOCK)
if (er == EWOULDBLOCK || er == EAGAIN)
return;
Sys_Printf(cluster, "udp send error %i\n", er);

View File

@ -111,6 +111,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//try the cygwin ones
#endif
#ifndef EAGAIN
#define EAGAIN EWOULDBLOCK
#endif
#ifndef pgetaddrinfo
#ifndef _WIN32
#define pgetaddrinfo getaddrinfo

View File

@ -572,7 +572,7 @@ qboolean Net_ReadStream(sv_t *qtv)
else
{
err = qerrno;
if (read == 0 || (err != EWOULDBLOCK && err != ENOTCONN)) //ENOTCONN can be returned whilst waiting for a connect to finish.
if (read == 0 || (err != EWOULDBLOCK && err != EAGAIN && err != ENOTCONN)) //ENOTCONN can be returned whilst waiting for a connect to finish.
{
if (qtv->file)
Sys_Printf(qtv->cluster, "Error: End of file\n");