mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-25 21:31:37 +00:00
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
3 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue