diff options
author | Astonex <softukitu@gmail.com> | 2013-07-24 01:33:08 +0100 |
---|---|---|
committer | Astonex <softukitu@gmail.com> | 2013-07-24 01:33:08 +0100 |
commit | 92398844a05bf5f0ce4333e0d4bd03c6e6633f77 (patch) | |
tree | 86710a8e50b7ab1c75136a3841da9553d819755b | |
parent | de7f72fa568494892f1c0cc7ba38db49a566d88f (diff) |
Changed the error checking to not just be Windows only
-rw-r--r-- | core/network.c | 10 |
1 files changed, 8 insertions, 2 deletions
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) | |||
121 | sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); | 121 | sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); |
122 | 122 | ||
123 | /* Check for socket error */ | 123 | /* Check for socket error */ |
124 | if (sock == INVALID_SOCKET) | 124 | #ifdef WIN32 |
125 | if (sock == INVALID_SOCKET) //MSDN recommends this | ||
125 | return -1; | 126 | return -1; |
126 | 127 | #else | |
128 | if (sock < 0) | ||
129 | return -1; | ||
130 | #endif | ||
131 | |||
132 | |||
127 | /* Functions to increase the size of the send and receive UDP buffers | 133 | /* Functions to increase the size of the send and receive UDP buffers |
128 | NOTE: uncomment if necessary */ | 134 | NOTE: uncomment if necessary */ |
129 | /* | 135 | /* |