summaryrefslogtreecommitdiff
path: root/backup.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2008-05-17 09:57:08 -0700
committerWayne Davison <wayned@samba.org>2008-05-17 09:57:08 -0700
commit88e05f8489acd2924bd48a156be4272906bf6884 (patch)
tree93b6ec0a28fe830a7b65858de7ed0d6ba91dc19e /backup.c
parent9ec8583ef56827c32736e03af8e053253365d4e1 (diff)
downloadrsync-88e05f8489acd2924bd48a156be4272906bf6884.tar.gz
rsync-88e05f8489acd2924bd48a156be4272906bf6884.tar.bz2
rsync-88e05f8489acd2924bd48a156be4272906bf6884.zip
Fixed an "else" in the device-making part of keep_backup().
Diffstat (limited to 'backup.c')
-rw-r--r--backup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/backup.c b/backup.c
index c3f66ebe..8b813b0d 100644
--- a/backup.c
+++ b/backup.c
@@ -245,10 +245,11 @@ static int keep_backup(const char *fname)
if ((am_root && preserve_devices && IS_DEVICE(file->mode))
|| (preserve_specials && IS_SPECIAL(file->mode))) {
uint32 *devp = F_RDEV_P(file);
+ int save_errno;
dev_t rdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
do_unlink(buf);
if (do_mknod(buf, file->mode, rdev) < 0) {
- int save_errno = errno ? errno : EINVAL; /* 0 paranoia */
+ save_errno = errno ? errno : EINVAL; /* 0 paranoia */
if (errno == ENOENT && make_bak_dir(buf) == 0) {
if (do_mknod(buf, file->mode, rdev) < 0)
save_errno = errno ? errno : save_errno;
@@ -259,7 +260,9 @@ static int keep_backup(const char *fname)
rsyserr(FERROR, save_errno, "mknod %s failed",
full_fname(buf));
}
- } else if (verbose > 2) {
+ } else
+ save_errno = 0;
+ if (verbose > 2 && save_errno == 0) {
rprintf(FINFO, "make_backup: DEVICE %s successful.\n",
fname);
}