From: Sebastian Harl Date: Fri, 20 Dec 2013 08:09:59 +0000 (+0100) Subject: frontend: Return an error if no handler threads could be created. X-Git-Tag: sysdb-0.1.0~303 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e78462d85dd6147ca1ff5a1e52d2ed5b6d1297a1;p=sysdb.git frontend: Return an error if no handler threads could be created. --- diff --git a/src/frontend/sock.c b/src/frontend/sock.c index 24708db..b5a3dcd 100644 --- a/src/frontend/sock.c +++ b/src/frontend/sock.c @@ -497,7 +497,7 @@ sdb_fe_sock_listen_and_serve(sdb_fe_socket_t *sock, sdb_fe_loop_t *loop) } } - while (loop->do_loop) { + while (loop->do_loop && num_threads) { struct timeval timeout = { 1, 0 }; /* one second */ sdb_llist_iter_t *iter; @@ -559,6 +559,9 @@ sdb_fe_sock_listen_and_serve(sdb_fe_socket_t *sock, sdb_fe_loop_t *loop) sdb_channel_destroy(sock->chan); sock->chan = NULL; + + if (! num_threads) + return -1; return 0; } /* sdb_fe_sock_listen_and_server */