diff options
| author | David Dykstra <dwd@samba.org> | 2003-01-27 03:35:08 +0000 |
|---|---|---|
| committer | David Dykstra <dwd@samba.org> | 2003-01-27 03:35:08 +0000 |
| commit | 9f639210ca71c548b76d311d826899ed36f98372 (patch) | |
| tree | 93d3d0d66c28388a51d69c7eae39303adfb55236 /socket.c | |
| parent | deec574421aea793cc2093e676adc798989181fa (diff) | |
| download | android_external_rsync-9f639210ca71c548b76d311d826899ed36f98372.tar.gz android_external_rsync-9f639210ca71c548b76d311d826899ed36f98372.tar.bz2 android_external_rsync-9f639210ca71c548b76d311d826899ed36f98372.zip | |
Prevent the "Connection reset by peer" messages often seen from Cygwin.
Result of a lot of discussion over the last year and a half. Based on
a patch from Randy O'Meara, cleaned up a bit by Max Bowsher.
Diffstat (limited to 'socket.c')
| -rw-r--r-- | socket.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |
