summaryrefslogtreecommitdiff
path: root/backup.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2008-05-22 16:44:01 -0700
committerWayne Davison <wayned@samba.org>2008-05-22 16:44:01 -0700
commita64f19e24b476e622d15bffeb81ce57c426b6943 (patch)
tree700b500205564aed918646bb7e075bd49ab4f143 /backup.c
parent4337eeb754bb0b8d903a96c2d3b35306484b12cc (diff)
downloadrsync-a64f19e24b476e622d15bffeb81ce57c426b6943.tar.gz
Fixed the backing up of a device or socket.
Diffstat (limited to 'backup.c')
-rw-r--r--backup.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/backup.c b/backup.c
index 8b813b0d..934f838d 100644
--- 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;