Ignore SIGPIPE, the return code of a nonblocking connect() is EINPROGRESS, not EWOULDBLOCK.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2125 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Mark Olsen 2006-03-17 20:12:11 +00:00
parent ca278f79e0
commit 7839d35975

View file

@ -18,6 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef _WIN32
#include <signal.h>
#endif
#include "qtv.h" #include "qtv.h"
#define RECONNECT_TIME (1000*30) #define RECONNECT_TIME (1000*30)
@ -238,7 +242,7 @@ qboolean Net_ConnectToTCPServer(sv_t *qtv, char *ip)
if (connect(qtv->sourcesock, (struct sockaddr *)&qtv->serveraddress, sizeof(qtv->serveraddress)) == INVALID_SOCKET) if (connect(qtv->sourcesock, (struct sockaddr *)&qtv->serveraddress, sizeof(qtv->serveraddress)) == INVALID_SOCKET)
{ {
if (qerrno != EWOULDBLOCK) if (qerrno != EINPROGRESS)
{ {
closesocket(qtv->sourcesock); closesocket(qtv->sourcesock);
qtv->sourcesock = INVALID_SOCKET; qtv->sourcesock = INVALID_SOCKET;
@ -427,6 +431,7 @@ void Net_TryFlushProxyBuffer(cluster_t *cluster, oproxy_t *prox)
char *buffer; char *buffer;
int length; int length;
int bufpos; int bufpos;
fd_set wfds;
while (prox->bufferpos >= MAX_PROXY_BUFFER) while (prox->bufferpos >= MAX_PROXY_BUFFER)
{ //so we never get any issues with wrapping.. { //so we never get any issues with wrapping..
@ -1777,6 +1782,10 @@ int main(int argc, char **argv)
{ {
cluster_t cluster; cluster_t cluster;
#ifndef _WIN32
signal(SIGPIPE, SIG_IGN);
#endif
#ifdef _WIN32 #ifdef _WIN32
{ {
WSADATA discard; WSADATA discard;