diff options
author | Ingela Anderton Andin <[email protected]> | 2016-03-02 15:53:38 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2016-03-02 15:53:38 +0100 |
commit | 0c330d97894b214bd78ec6a2afd207a7c20c5140 (patch) | |
tree | b03f424f8965dae73dc15b1538b2a7c8e39d747c /erts/epmd | |
parent | f2f3093222b37dba42b6eb7e7c4cbecf7655305c (diff) | |
parent | 9020ce9ab8347a781d4f761a1389bec4fd2bb468 (diff) | |
download | otp-0c330d97894b214bd78ec6a2afd207a7c20c5140.tar.gz otp-0c330d97894b214bd78ec6a2afd207a7c20c5140.tar.bz2 otp-0c330d97894b214bd78ec6a2afd207a7c20c5140.zip |
Merge branch 'maint'
Diffstat (limited to 'erts/epmd')
-rw-r--r-- | erts/epmd/src/epmd_srv.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c index 84a2e0a3ea..75a33f28cb 100644 --- a/erts/epmd/src/epmd_srv.c +++ b/erts/epmd/src/epmd_srv.c @@ -375,7 +375,7 @@ void run(EpmdVars *g) epmd_cleanup_exit(g,1); } } - g->listenfd[i] = listensock[i]; + g->listenfd[bound++] = listensock[i]; #if HAVE_DECL_IPV6_V6ONLY opt = 1; @@ -434,8 +434,6 @@ void run(EpmdVars *g) } } - bound++; - if(listen(listensock[i], SOMAXCONN) < 0) { dbg_perror(g,"failed to listen on socket"); epmd_cleanup_exit(g,1); @@ -446,6 +444,7 @@ void run(EpmdVars *g) dbg_perror(g,"unable to bind any address"); epmd_cleanup_exit(g,1); } + num_sockets = bound; #ifdef HAVE_SYSTEMD_DAEMON } sd_notifyf(0, "READY=1\n" @@ -490,8 +489,8 @@ void run(EpmdVars *g) } for (i = 0; i < num_sockets; i++) - if (FD_ISSET(listensock[i],&read_mask)) { - if (do_accept(g, listensock[i]) && g->active_conn < g->max_conn) { + if (FD_ISSET(g->listenfd[i],&read_mask)) { + if (do_accept(g, g->listenfd[i]) && g->active_conn < g->max_conn) { /* * The accept() succeeded, and we have at least one file * descriptor still free, which means that another accept() |