From 92398844a05bf5f0ce4333e0d4bd03c6e6633f77 Mon Sep 17 00:00:00 2001 From: Astonex Date: Wed, 24 Jul 2013 01:33:08 +0100 Subject: Changed the error checking to not just be Windows only --- core/network.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core/network.c') diff --git a/core/network.c b/core/network.c index 8c8d8875..bc6738ac 100644 --- a/core/network.c +++ b/core/network.c @@ -121,9 +121,15 @@ int init_networking(IP ip ,uint16_t port) sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); /* Check for socket error */ - if (sock == INVALID_SOCKET) + #ifdef WIN32 + if (sock == INVALID_SOCKET) //MSDN recommends this return -1; - + #else + if (sock < 0) + return -1; + #endif + + /* Functions to increase the size of the send and receive UDP buffers NOTE: uncomment if necessary */ /* -- cgit v1.2.3