Fixed the backing up of a device or socket.
authorWayne Davison <wayned@samba.org>
Thu, 22 May 2008 23:44:01 +0000 (16:44 -0700)
committerWayne Davison <wayned@samba.org>
Thu, 22 May 2008 23:44:01 +0000 (16:44 -0700)
backup.c

index 8b813b0..934f838 100644 (file)
--- a/backup.c
+++ b/backup.c
@@ -244,14 +244,12 @@ static int keep_backup(const char *fname)
        /* Check to see if this is a device file, or link */
        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) {
+               if (do_mknod(buf, file->mode, sx.st.st_rdev) < 0) {
                        save_errno = errno ? errno : EINVAL; /* 0 paranoia */
                        if (errno == ENOENT && make_bak_dir(buf) == 0) {
-                               if (do_mknod(buf, file->mode, rdev) < 0)
+                               if (do_mknod(buf, file->mode, sx.st.st_rdev) < 0)
                                        save_errno = errno ? errno : save_errno;
                                else
                                        save_errno = 0;