|  | @@ -420,6 +420,8 @@ int main (int argc, char **argv)
 | 
		
	
		
			
			| 420 | 420 |      char keybuf[1024], *key;
 | 
		
	
		
			
			| 421 | 421 |  
 | 
		
	
		
			
			| 422 | 422 |      if (poll(fds, 2, 1000) < 0) {
 | 
		
	
		
			
			|  | 423 | +      if (errno == EINTR)
 | 
		
	
		
			
			|  | 424 | +        continue;
 | 
		
	
		
			
			| 423 | 425 |        if (daemonize)
 | 
		
	
		
			
			| 424 | 426 |          syslog (LOG_MAIL | LOG_ERR, "Poll failure: %s", strerror(errno));
 | 
		
	
		
			
			| 425 | 427 |        else
 | 
		
	
	
		
			
			|  | @@ -431,6 +433,10 @@ int main (int argc, char **argv)
 | 
		
	
		
			
			| 431 | 433 |          conn = accept(fds[i].fd, NULL, NULL);
 | 
		
	
		
			
			| 432 | 434 |          if (conn < 0) continue;
 | 
		
	
		
			
			| 433 | 435 |          if (fork() == 0) {
 | 
		
	
		
			
			|  | 436 | +          // close listen sockets so that we don't stop the main daemon process from restarting
 | 
		
	
		
			
			|  | 437 | +          close(forward_sock);
 | 
		
	
		
			
			|  | 438 | +          close(reverse_sock);
 | 
		
	
		
			
			|  | 439 | +
 | 
		
	
		
			
			| 434 | 440 |            fp = fdopen(conn, "r+");
 | 
		
	
		
			
			| 435 | 441 |            if (fp == NULL) exit(EXIT_FAILURE);
 | 
		
	
		
			
			| 436 | 442 |            fds[2].fd = conn;
 |