From f25fa7b132ef08431455075dadcf1823a5796dba Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Mon, 13 Feb 2017 18:02:32 +0100 Subject: Seems to work reasonably well. --- src/server/server_new_connection.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/server/server_new_connection.c') diff --git a/src/server/server_new_connection.c b/src/server/server_new_connection.c index 46b38fc..c29b896 100644 --- a/src/server/server_new_connection.c +++ b/src/server/server_new_connection.c @@ -25,10 +25,10 @@ static int get_new_socket (struct ZoO_server server [const restrict static 1]) if (server->thread_params.socket == -1) { - fprintf + ZoO_ERROR ( stderr, - "[E] Unable to accept on the server's socket: %s.\n", + "Unable to accept on the server's socket: %s.", strerror(errno) ); @@ -71,11 +71,10 @@ static int get_new_thread (struct ZoO_server server [const restrict static 1]) ) ) { - fprintf + ZoO_S_ERROR ( stderr, - "[E] Maximum number of concurrent threads attained, unable to add" - " more.\n" + "Maximum number of concurrent threads attained, unable to add more." ); pthread_mutex_unlock(&(server->workers.mutex)); @@ -98,10 +97,10 @@ static int get_new_thread (struct ZoO_server server [const restrict static 1]) if (new_threads == ((struct ZoO_server_thread_data *) NULL)) { - fprintf + ZoO_S_ERROR ( stderr, - "[E] Reallocation of the threads' data list failed.\n" + "Reallocation of the threads' data list failed." ); pthread_mutex_unlock(&(server->workers.mutex)); @@ -134,10 +133,10 @@ static int spawn_thread (struct ZoO_server server [const restrict static 1]) if (error != 0) { - fprintf + ZoO_ERROR ( stderr, - "[E] Unable to spawn thread: %s.\n", + "Unable to spawn thread: %s.", strerror(error) ); -- cgit v1.2.3-70-g09d2