diff --git a/server/src/main.c b/server/src/main.c index dad77ff..8cd5ad0 100644 --- a/server/src/main.c +++ b/server/src/main.c @@ -65,7 +65,8 @@ int main(int argc, char **argv) { err = socket_thread(&pthread_socket, &data); if (err) goto handle_error; - pthread_join(pthread_socket, NULL); + pthread_join(pthread_socket, (void **)&err); // No way this is correct lol + if (err) goto handle_error; // Deinitialisation pthread_mutex_destroy(&data.world_lock); diff --git a/server/src/socket.c b/server/src/socket.c index e88bf9b..e35d98b 100644 --- a/server/src/socket.c +++ b/server/src/socket.c @@ -67,7 +67,7 @@ static enum error_t socket_handle(struct game_data_t *data) { } -static void *socket_thread_fn(void *data_void) { +static void *socket_thread_body(void *data_void) { assert(data_void != NULL); struct game_data_t *data = (struct game_data_t *)data_void; @@ -100,7 +100,7 @@ error: enum error_t socket_thread(pthread_t *pthread, struct game_data_t *data) { - int err = pthread_create(pthread, NULL, socket_thread_fn, data); + int err = pthread_create(pthread, NULL, socket_thread_body, data); if (err != 0) return ERR_THREAD; return ERR_OK;