summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1999-04-06 14:52:32 +0000
committerAndrew Tridgell <tridge@samba.org>1999-04-06 14:52:32 +0000
commit9bd659766688c8fbb8dc71d36ab6a352052d3b7e (patch)
tree7e6bd055763ea871d52d90c7929190fa5686feba
parent6fe076b3d7096cb999c9df6e173ba367bc8ea5fd (diff)
downloadrsync-9bd659766688c8fbb8dc71d36ab6a352052d3b7e.tar.gz
set the exit code to RERR_FILEIO is io_error is set when we exit. This
catches most sorts of io errors and ensures we report a error in our exit status.
-rw-r--r--cleanup.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cleanup.c b/cleanup.c
index be795034..b4ac82ad 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -30,11 +30,14 @@ static struct file_struct *cleanup_file;
static int cleanup_fd1, cleanup_fd2;
static struct map_struct *cleanup_buf;
static int cleanup_pid = 0;
+extern int io_error;
void _exit_cleanup(int code, const char *file, int line)
{
extern int keep_partial;
+ if (code == 0 && io_error) code = RERR_FILEIO;
+
signal(SIGUSR1, SIG_IGN);
if (cleanup_got_literal && cleanup_fname && keep_partial) {