]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Drop extra listen() call in gss-server 1171/head
authorIvan A. Melnikov <iv@altlinux.org>
Tue, 16 Mar 2021 10:18:01 +0000 (14:18 +0400)
committerGreg Hudson <ghudson@mit.edu>
Tue, 16 Mar 2021 20:32:18 +0000 (16:32 -0400)
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
src/tests/gss-threads/gss-server.c

index a0e19fca59297ee4a5aa6834deb0f59271344ff8..9b6ce9ffb3db068af42e48054cb06be6dd17d5a0 100644 (file)
@@ -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 {
index 42136a81f510feb073563159974dc0ef01af9ab5..a9f980edb214c555978a83b4a98ec7de505615e3 100644 (file)
@@ -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));