From 4006d79532b19c352473ed80c7a1dd237707f513 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 22 Oct 2006 17:16:43 +0000 Subject: [PATCH] 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 --- fteqtv/netchan.c | 2 +- fteqtv/qtv.h | 4 ++++ fteqtv/source.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fteqtv/netchan.c b/fteqtv/netchan.c index cec21b524..ccda848e8 100644 --- a/fteqtv/netchan.c +++ b/fteqtv/netchan.c @@ -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); diff --git a/fteqtv/qtv.h b/fteqtv/qtv.h index a08a099ac..c708f67bc 100644 --- a/fteqtv/qtv.h +++ b/fteqtv/qtv.h @@ -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 diff --git a/fteqtv/source.c b/fteqtv/source.c index fd869a761..52a520983 100644 --- a/fteqtv/source.c +++ b/fteqtv/source.c @@ -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");