From 239f0c9d38a2a57f0b52963bb552c7bb512274f6 Mon Sep 17 00:00:00 2001 From: Molgrum Date: Sun, 4 Nov 2007 08:21:19 +0000 Subject: [PATCH] I guess all of these are to be changed too, please confirm. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2779 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/sv_mvd.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/engine/server/sv_mvd.c b/engine/server/sv_mvd.c index 6d35a4721..fbbfa3f0d 100644 --- a/engine/server/sv_mvd.c +++ b/engine/server/sv_mvd.c @@ -162,7 +162,7 @@ void SV_MVD_RunPendingConnections(void) if (p->nextdest->error) { np = p->nextdest->nextdest; - if (p->nextdest->socket != -1) + if (p->nextdest->socket != INVALID_SOCKET) closesocket(p->nextdest->socket); Z_Free(p->nextdest); p->nextdest = np; @@ -465,7 +465,7 @@ void SV_MVD_RunPendingConnections(void) else { SV_MVD_Record(SV_InitStream(p->socket)); - p->socket = -1; //so it's not cleared wrongly. + p->socket = INVALID_SOCKET; //so it's not cleared wrongly. } p->error = true; } @@ -482,7 +482,7 @@ void SV_MVD_RunPendingConnections(void) dst = SV_InitStream(p->socket); dst->droponmapchange = p->isreverse; SV_MVD_Record(dst); - p->socket = -1; //so it's not cleared wrongly. + p->socket = INVALID_SOCKET; //so it's not cleared wrongly. } else { @@ -2089,27 +2089,27 @@ void SV_MVD_QTVReverse_f (void) local.sin_addr.s_addr = INADDR_ANY; local.sin_port = 0; - if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) + if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) { Con_Printf ("qtvreverse: socket: %s\n", strerror(qerrno)); return; } - if( bind (sock, (void *)&local, sizeof(local)) == -1) + if( bind (sock, (void *)&local, sizeof(local)) == INVALID_SOCKET) { closesocket(sock); Con_Printf ("qtvreverse: bind: %s\n", strerror(qerrno)); return; } - if (connect(sock, (void*)&remote, sizeof(remote)) == -1) + if (connect(sock, (void*)&remote, sizeof(remote)) == INVALID_SOCKET) { closesocket(sock); Con_Printf ("qtvreverse: connect: %s\n", strerror(qerrno)); return; } - if (ioctlsocket (sock, FIONBIO, &nonblocking) == -1) + if (ioctlsocket (sock, FIONBIO, &nonblocking) == INVALID_SOCKET) { closesocket(sock); Con_Printf ("qtvreverse: ioctl FIONBIO: %s\n", strerror(qerrno)); @@ -2119,7 +2119,7 @@ void SV_MVD_QTVReverse_f (void) data = "QTV\n" "REVERSE\n" "\n"; - if (send(sock, data, strlen(data), 0) == -1) + if (send(sock, data, strlen(data), 0) == INVALID_SOCKET) { closesocket(sock); Con_Printf ("qtvreverse: send: %s\n", strerror(qerrno)); @@ -2357,17 +2357,17 @@ int MVD_StreamStartListening(int port) - if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) + if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) { Sys_Error ("MVD_StreamStartListening: socket:", strerror(qerrno)); } - if (ioctlsocket (sock, FIONBIO, &nonblocking) == -1) + if (ioctlsocket (sock, FIONBIO, &nonblocking) == INVALID_SOCKET) { Sys_Error ("FTP_TCP_OpenSocket: ioctl FIONBIO:", strerror(qerrno)); } - if( bind (sock, (void *)&address, sizeof(address)) == -1) + if( bind (sock, (void *)&address, sizeof(address)) == INVALID_SOCKET) { closesocket(sock); return INVALID_SOCKET;