aboutsummaryrefslogtreecommitdiffstats
path: root/cleanup.c
diff options
context:
space:
mode:
authorDavid Dykstra <dwd@samba.org>2003-01-16 20:09:31 +0000
committerDavid Dykstra <dwd@samba.org>2003-01-16 20:09:31 +0000
commitb765ec32b93d8fa78f19a48fbc7cc9066beb488e (patch)
treee4636892ed8d41ec3321952409173d17fd86b570 /cleanup.c
parenta70d070cc52c177bd974e6787788f946be9cb285 (diff)
downloadandroid_external_rsync-b765ec32b93d8fa78f19a48fbc7cc9066beb488e.tar.gz
android_external_rsync-b765ec32b93d8fa78f19a48fbc7cc9066beb488e.tar.bz2
android_external_rsync-b765ec32b93d8fa78f19a48fbc7cc9066beb488e.zip
Prevent infinite recursion in exit_cleanup(). Patch from Sviatoslav Sviridov.
Diffstat (limited to 'cleanup.c')
-rw-r--r--cleanup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cleanup.c b/cleanup.c
index 37e074a0..b9e9dabe 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -61,6 +61,13 @@ void _exit_cleanup(int code, const char *file, int line)
int ocode = code;
extern int keep_partial;
extern int log_got_error;
+ static int inside_cleanup = 0;
+
+ if (inside_cleanup != 0) {
+ /* prevent the occasional infinite recursion */
+ return;
+ }
+ inside_cleanup = 1;
signal(SIGUSR1, SIG_IGN);
signal(SIGUSR2, SIG_IGN);