summaryrefslogtreecommitdiff
path: root/cleanup.c
diff options
context:
space:
mode:
authorDavid Dykstra <dwd@samba.org>2003-01-26 03:53:34 +0000
committerDavid Dykstra <dwd@samba.org>2003-01-26 03:53:34 +0000
commitaa2c47d83558ebb5def69d6c2fa2d6fe70b49db0 (patch)
tree948307a182becf7854c87429f0121a453b50e426 /cleanup.c
parent536b84680b4ab1f29fa456b4fa7b5b16eff4af8f (diff)
downloadrsync-aa2c47d83558ebb5def69d6c2fa2d6fe70b49db0.tar.gz
Better fix for infinite recursion; don't return from exit_cleanup
unless the nesting is already pretty deep, because there are normal cases where exit_cleanup is nested shallowly. Patch from Marc Espie, posted by Brian Poole.
Diffstat (limited to 'cleanup.c')
-rw-r--r--cleanup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cleanup.c b/cleanup.c
index b9e9dabe..8543217d 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -63,11 +63,11 @@ void _exit_cleanup(int code, const char *file, int line)
extern int log_got_error;
static int inside_cleanup = 0;
- if (inside_cleanup != 0) {
+ if (inside_cleanup > 10) {
/* prevent the occasional infinite recursion */
return;
}
- inside_cleanup = 1;
+ inside_cleanup++;
signal(SIGUSR1, SIG_IGN);
signal(SIGUSR2, SIG_IGN);