From: Ivan A. Melnikov Date: Tue, 16 Mar 2021 10:18:01 +0000 (+0400) Subject: Drop extra listen() call in gss-server X-Git-Tag: krb5-1.20-beta1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=926ab71da02b5b44f1ebd83977b31c653a556a92;p=thirdparty%2Fkrb5.git 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. --- 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));