There is already call to listen in create_socket(), and there is no
need to tie the backlog to the number of threads. Also, here listen()
was sometimes called with zero backlog, making gss-server execution
(and tests) racy on slower and busy systems.
int stmp;
if ((stmp = create_socket(port)) >= 0) {
- if (listen(stmp, max_threads == 1 ? 0 : max_threads) < 0)
- perror("listening on socket");
fprintf(stderr, "starting...\n");
do {
stmp = create_socket(port);
if (stmp >= 0) {
- if (listen(stmp, max_threads == 1 ? 0 : max_threads) < 0)
- perror("listening on socket");
-
do {
struct _work_plan * work = malloc(sizeof(struct _work_plan));