Skip to content

Commit

Permalink
Drop extra listen() call in gss-server
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iv-m authored and greghudson committed Mar 16, 2021
1 parent c5c1183 commit 926ab71
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/appl/gss-sample/gss-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions src/tests/gss-threads/gss-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 926ab71

Please sign in to comment.