From: Martin Pool Date: Mon, 18 Feb 2002 22:58:49 +0000 (+0000) Subject: Fix error handling for failing to fork after accepting a connection -- X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/bd37c6663080198fc8ba60a50f3ccfe11b09fe69 Fix error handling for failing to fork after accepting a connection -- close fd, sleep, then try again. --- diff --git a/socket.c b/socket.c index 843c19b6..c4420ba7 100644 --- a/socket.c +++ b/socket.c @@ -435,9 +435,9 @@ void start_accept_loop(int port, int (*fn)(int )) * overloaded. Sleep briefly before trying to * accept again. */ sleep(2); + } else { + close(fd); } - - close(fd); } }