From a5e233fb11a7c43d27ce5194024bdd804d85b518 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Tue, 1 Oct 2019 23:58:49 -0700 Subject: [PATCH] Fixed another instance of only checking for EAGAIN from a socket, from Ala-lala --- sc2/src/uqm/supermelee/netplay/netmelee.c | 4 +++- sc2/src/uqm/supermelee/netplay/packetq.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sc2/src/uqm/supermelee/netplay/netmelee.c b/sc2/src/uqm/supermelee/netplay/netmelee.c index 58f931b74..a784d8582 100644 --- a/sc2/src/uqm/supermelee/netplay/netmelee.c +++ b/sc2/src/uqm/supermelee/netplay/netmelee.c @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define PORT_WANT_ERRNO +#include "port.h" #include "netmelee.h" #include "libs/alarm.h" #include "libs/callback.h" @@ -197,7 +199,7 @@ flushPacketQueues(void) { continue; flushStatus = flushPacketQueue(conn); - if (flushStatus == -1 && errno != EAGAIN) + if (flushStatus == -1 && errno != EAGAIN && errno != EWOULDBLOCK) closePlayerNetworkConnection(player); } } diff --git a/sc2/src/uqm/supermelee/netplay/packetq.c b/sc2/src/uqm/supermelee/netplay/packetq.c index eabd2d04b..ee8ec012b 100644 --- a/sc2/src/uqm/supermelee/netplay/packetq.c +++ b/sc2/src/uqm/supermelee/netplay/packetq.c @@ -104,8 +104,8 @@ queuePacket(NetConnection *conn, Packet *packet) { // If an error occurs during sending, we leave the unsent packets in // the queue, and let the caller decide what to do with them. -// This function may return -1 with errno EAGAIN if we're waiting for -// the other party to act first. +// This function may return -1 with errno EAGAIN or EWOULDBLOCK +// if we're waiting for the other party to act first. static int flushPacketQueueLinks(NetConnection *conn, PacketQueueLink **first) { PacketQueueLink *link;