diff options
-rw-r--r-- | core/network.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/network.c b/core/network.c index 849c7e2a..7880eae6 100644 --- a/core/network.c +++ b/core/network.c | |||
@@ -108,10 +108,10 @@ void networking_poll(Networking_Core *net) | |||
108 | } | 108 | } |
109 | 109 | ||
110 | uint8_t at_startup_ran; | 110 | uint8_t at_startup_ran; |
111 | static void at_startup(void) | 111 | static int at_startup(void) |
112 | { | 112 | { |
113 | if (at_startup_ran != 0) | 113 | if (at_startup_ran != 0) |
114 | return; | 114 | return 0; |
115 | 115 | ||
116 | #ifdef WIN32 | 116 | #ifdef WIN32 |
117 | WSADATA wsaData; | 117 | WSADATA wsaData; |
@@ -124,6 +124,7 @@ static void at_startup(void) | |||
124 | #endif | 124 | #endif |
125 | srand((uint32_t)current_time()); | 125 | srand((uint32_t)current_time()); |
126 | at_startup_ran = 1; | 126 | at_startup_ran = 1; |
127 | return 0; | ||
127 | } | 128 | } |
128 | 129 | ||
129 | /* TODO: put this somewhere | 130 | /* TODO: put this somewhere |
@@ -143,7 +144,8 @@ static void at_shutdown(void) | |||
143 | returns NULL if there are problems */ | 144 | returns NULL if there are problems */ |
144 | Networking_Core *new_networking(IP ip, uint16_t port) | 145 | Networking_Core *new_networking(IP ip, uint16_t port) |
145 | { | 146 | { |
146 | at_startup(); | 147 | if(at_startup() != 0) |
148 | return NULL; | ||
147 | /* initialize our socket */ | 149 | /* initialize our socket */ |
148 | Networking_Core *temp = calloc(1, sizeof(Networking_Core)); | 150 | Networking_Core *temp = calloc(1, sizeof(Networking_Core)); |
149 | 151 | ||