X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/8638dd48f71023642d3af282250bbe157ee9b67d..5a788adec19043d4d93c4fa2713f9f633bfd35ab:/cleanup.c diff --git a/cleanup.c b/cleanup.c index abd7b0df..ee2fa4d5 100644 --- a/cleanup.c +++ b/cleanup.c @@ -51,8 +51,15 @@ void exit_cleanup(int code) if (code) { kill_all(SIGUSR1); } - if ((cleanup_pid != 0) && (cleanup_pid == (int) getpid())) - unlink(lp_pid_file()); + if ((cleanup_pid != 0) && (cleanup_pid == (int) getpid())) { + char *pidf = lp_pid_file(); + if (pidf && *pidf) { + unlink(lp_pid_file()); + } + } + + if (code) log_exit(code); + exit(code); }