X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/fd2dd2aa231954db2bcc0b60f2a696bc38161aa9..ff81e809f46293171a332a2faa320aca57277b4b:/cleanup.c diff --git a/cleanup.c b/cleanup.c index bd562ae6..4b9cad3a 100644 --- a/cleanup.c +++ b/cleanup.c @@ -40,6 +40,7 @@ extern int io_error; void _exit_cleanup(int code, const char *file, int line) { extern int keep_partial; + extern int log_got_error; if (code == 0 && io_error) code = RERR_FILEIO; @@ -69,6 +70,12 @@ void _exit_cleanup(int code, const char *file, int line) if (code) log_exit(code, file, line); + if (code == 0) { + if (log_got_error) { + code = RERR_FILEIO; + } + } + exit(code); }