From 88e05f8489acd2924bd48a156be4272906bf6884 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 17 May 2008 09:57:08 -0700 Subject: [PATCH] Fixed an "else" in the device-making part of keep_backup(). --- backup.c | 7 +++++-- 1 file 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); } -- 2.34.1