From 926ab71da02b5b44f1ebd83977b31c653a556a92 Mon Sep 17 00:00:00 2001 From: "Ivan A. Melnikov" Date: Tue, 16 Mar 2021 14:18:01 +0400 Subject: [PATCH] Drop extra listen() call in gss-server 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. --- src/appl/gss-sample/gss-server.c | 2 -- src/tests/gss-threads/gss-server.c | 3 --- 2 files changed, 5 deletions(-) diff --git a/src/appl/gss-sample/gss-server.c b/src/appl/gss-sample/gss-server.c index a0e19fca59..9b6ce9ffb3 100644 --- a/src/appl/gss-sample/gss-server.c +++ b/src/appl/gss-sample/gss-server.c @@ -766,8 +766,6 @@ main(int argc, char **argv) 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 { diff --git a/src/tests/gss-threads/gss-server.c b/src/tests/gss-threads/gss-server.c index 42136a81f5..a9f980edb2 100644 --- a/src/tests/gss-threads/gss-server.c +++ b/src/tests/gss-threads/gss-server.c @@ -782,9 +782,6 @@ main(int argc, char **argv) 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)); -- 2.47.2