From da1b95a8ded80fb5dc07e93a3a7538d39b59740e Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 28 Jul 2013 12:13:54 +0200 Subject: [PATCH] Remove function cast for worker_thread. --- src/tlsproxy.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tlsproxy.c b/src/tlsproxy.c index 0f3481e..0eefaa3 100644 --- a/src/tlsproxy.c +++ b/src/tlsproxy.c @@ -76,7 +76,7 @@ static void print_usage(const char *argv); static void initialize_gnutls(void); static void deinitialize_gnutls(void); -static void worker_thread(void); +static void *worker_thread(void *unused); int main(int argc, char **argv) { @@ -136,9 +136,7 @@ int main(int argc, char **argv) { return EXIT_FAILURE; } for (i = 0; i < thread_count; i++) { - errno = pthread_create(threads + i, NULL, - (void * (*)(void *))&worker_thread, - NULL); + errno = pthread_create(threads + i, NULL, &worker_thread, NULL); if (errno != 0) { perror("failed to create worker thread"); return EXIT_FAILURE; @@ -384,9 +382,11 @@ static void deinitialize_gnutls(void) { gnutls_global_deinit(); } -static void worker_thread(void) { +static void *worker_thread(void *unused) { int client_socket; + (void)unused; + for (;;) { /* Get next element from ring buffer. */ P(ringbuffer_full); @@ -403,4 +403,6 @@ static void worker_thread(void) { handle_connection(client_socket); } + + return NULL; } -- 2.45.2