Changed the code that cleans up the old nightly releases from
[rsync/rsync.git] / backup.c
index 1560255..c0f924f 100644 (file)
--- a/backup.c
+++ b/backup.c
@@ -2,12 +2,11 @@
  * Backup handling code.
  *
  * Copyright (C) 1999 Andrew Tridgell
- * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison
+ * Copyright (C) 2003-2007 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -192,7 +191,8 @@ 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))) {
-               dev_t rdev = MAKEDEV(F_DMAJOR(file), F_DMINOR(file));
+               uint32 *devp = F_RDEV_P(file);
+               dev_t rdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
                do_unlink(buf);
                if (do_mknod(buf, file->mode, rdev) < 0
                    && (errno != ENOENT || make_bak_dir(buf) < 0