Skip to content

Commit

Permalink
core: pt - check to avoid two times closing unneeded sockets
Browse files Browse the repository at this point in the history
(cherry picked from commit 0225f89)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent ac21783 commit e0078a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/pt.c
Expand Up @@ -210,14 +210,14 @@ int close_extra_socks(int child_id, int proc_no)
/* close all listen sockets (needed only in tcp_main */
if (!tcp_disable){
for(si=tcp_listen; si; si=si->next){
close(si->socket);
if(si->socket>=0) close(si->socket);
/* safe to change since this is a per process copy */
si->socket=-1;
}
#ifdef USE_TLS
if (!tls_disable){
for(si=tls_listen; si; si=si->next){
close(si->socket);
if(si->socket>=0) close(si->socket);
/* safe to change since this is a per process copy */
si->socket=-1;
}
Expand Down

0 comments on commit e0078a5

Please sign in to comment.