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:
parent
af5348a8f2
commit
4006d79532
|
@ -32,7 +32,7 @@ void NET_SendPacket(cluster_t *cluster, SOCKET sock, int length, char *data, net
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
int er = qerrno;
|
int er = qerrno;
|
||||||
if (er == EWOULDBLOCK)
|
if (er == EWOULDBLOCK || er == EAGAIN)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Sys_Printf(cluster, "udp send error %i\n", er);
|
Sys_Printf(cluster, "udp send error %i\n", er);
|
||||||
|
|
|
@ -111,6 +111,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//try the cygwin ones
|
//try the cygwin ones
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef EAGAIN
|
||||||
|
#define EAGAIN EWOULDBLOCK
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef pgetaddrinfo
|
#ifndef pgetaddrinfo
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#define pgetaddrinfo getaddrinfo
|
#define pgetaddrinfo getaddrinfo
|
||||||
|
|
|
@ -572,7 +572,7 @@ qboolean Net_ReadStream(sv_t *qtv)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
err = qerrno;
|
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)
|
if (qtv->file)
|
||||||
Sys_Printf(qtv->cluster, "Error: End of file\n");
|
Sys_Printf(qtv->cluster, "Error: End of file\n");
|
||||||
|
|
Loading…
Reference in New Issue