X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/39993af514cadf3764c355fe687110d5ea9b0b01..3c30b9905932e39b170be8e0521370727f264635:/socket.c diff --git a/socket.c b/socket.c index fa8e4572..eb0660bb 100644 --- a/socket.c +++ b/socket.c @@ -429,11 +429,14 @@ void start_accept_loop(int port, int (*fn)(int, int)) #endif if ((pid = fork()) == 0) { + int ret; close(s); /* open log file in child before possibly giving up privileges */ log_open(); - _exit(fn(fd, fd)); + ret = fn(fd, fd); + close_all(); + _exit(ret); } else if (pid < 0) { rprintf(FERROR, RSYNC_NAME