forgot the socket_thread_body return value handling

This commit is contained in:
snit 2024-10-27 23:02:08 -05:00
parent bb71248414
commit 693c238664
2 changed files with 4 additions and 3 deletions

View File

@ -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);

View File

@ -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;