From 9ed569486f12982605e08117113f150fa38827ab Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 31 Jul 2008 07:55:59 -0700 Subject: [PATCH] Output an FERROR* for a general io_error, and an FWARNING for other io_error flags. --- NEWS | 2 ++ exclude.c | 2 +- flist.c | 12 ++++++------ generator.c | 2 +- sender.c | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index efddfe8f..29f1ef2e 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,8 @@ Changes since 3.0.3: - Fixed a potential alignment issue in the IRIX ACL code when allocating the initial "struct acl" object. Also, cast mallocs to avoid warnings. + - Changed some errors that were going to stdout to go to stderr. + ENHANCEMENTS: - Rsync will avoid sending an -e option to the server if an older protocol diff --git a/exclude.c b/exclude.c index 085d2642..ee1ffceb 100644 --- a/exclude.c +++ b/exclude.c @@ -476,7 +476,7 @@ void *push_local_filters(const char *dir, unsigned int dirlen) XFLG_ANCHORED2ABS); } else { io_error |= IOERR_GENERAL; - rprintf(FINFO, + rprintf(FERROR, "cannot add local filter rules in long-named directory: %s\n", full_fname(dirbuf)); } diff --git a/flist.c b/flist.c index f90ae291..2c45cc61 100644 --- a/flist.c +++ b/flist.c @@ -375,7 +375,7 @@ int change_pathname(struct file_struct *file, const char *dir, int dirlen) if (!change_dir(dir, CD_NORMAL)) { chdir_error: io_error |= IOERR_GENERAL; - rsyserr(FERROR, errno, "change_dir %s failed", full_fname(dir)); + rsyserr(FERROR_XFER, errno, "change_dir %s failed", full_fname(dir)); if (dir != orig_dir) change_dir(orig_dir, CD_NORMAL); pathname = NULL; @@ -675,7 +675,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist, if (iconvbufs(ic_recv, &inbuf, &outbuf, 0) < 0) { io_error |= IOERR_GENERAL; - rprintf(FINFO, + rprintf(FERROR_XFER, "[%s] cannot convert filename: %s (%s)\n", who_am_i(), lastname, strerror(errno)); outbuf.len = 0; @@ -1045,7 +1045,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, if (strlcpy(thisname, fname, sizeof thisname) >= sizeof thisname) { io_error |= IOERR_GENERAL; - rprintf(FINFO, "skipping overly long name: %s\n", fname); + rprintf(FERROR_XFER, "skipping overly long name: %s\n", fname); return NULL; } clean_fname(thisname, 0); @@ -1333,7 +1333,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist, if (iconvbufs(ic_send, &inbuf, &outbuf, 0) < 0) { convert_error: io_error |= IOERR_GENERAL; - rprintf(FINFO, + rprintf(FERROR_XFER, "[%s] cannot convert filename: %s (%s)\n", who_am_i(), f_name(file, fbuf), strerror(errno)); return NULL; @@ -1558,14 +1558,14 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len, continue; if (strlcpy(p, dname, remainder) >= remainder) { io_error |= IOERR_GENERAL; - rprintf(FINFO, + rprintf(FERROR_XFER, "cannot send long-named file %s\n", full_fname(fbuf)); continue; } if (dname[0] == '\0') { io_error |= IOERR_GENERAL; - rprintf(FINFO, + rprintf(FERROR_XFER, "cannot send file with empty name in %s\n", full_fname(fbuf)); continue; diff --git a/generator.c b/generator.c index 11cba3c8..26c6d170 100644 --- a/generator.c +++ b/generator.c @@ -2335,7 +2335,7 @@ void generate_files(int f_out, const char *local_name) touch_up_dirs(dir_flist, -1); if (max_delete >= 0 && deletion_count > max_delete) { - rprintf(FINFO, + rprintf(FWARNING, "Deletions stopped due to --max-delete limit (%d skipped)\n", deletion_count - max_delete); io_error |= IOERR_DEL_LIMIT; diff --git a/sender.c b/sender.c index f7728772..74d0634b 100644 --- a/sender.c +++ b/sender.c @@ -281,7 +281,7 @@ void send_files(int f_in, int f_out) if (!(s = receive_sums(f_in))) { io_error |= IOERR_GENERAL; - rprintf(FERROR, "receive_sums failed\n"); + rprintf(FERROR_XFER, "receive_sums failed\n"); exit_cleanup(RERR_PROTOCOL); } @@ -309,7 +309,7 @@ void send_files(int f_in, int f_out) /* map the local file */ if (do_fstat(fd, &st) != 0) { io_error |= IOERR_GENERAL; - rsyserr(FERROR, errno, "fstat failed"); + rsyserr(FERROR_XFER, errno, "fstat failed"); free_sums(s); close(fd); exit_cleanup(RERR_PROTOCOL); -- 2.34.1