diff options
author | Wayne Davison <wayned@samba.org> | 2008-05-22 16:44:01 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2008-05-22 16:44:01 -0700 |
commit | a64f19e24b476e622d15bffeb81ce57c426b6943 (patch) | |
tree | 700b500205564aed918646bb7e075bd49ab4f143 /backup.c | |
parent | 4337eeb754bb0b8d903a96c2d3b35306484b12cc (diff) | |
download | rsync-a64f19e24b476e622d15bffeb81ce57c426b6943.tar.gz rsync-a64f19e24b476e622d15bffeb81ce57c426b6943.tar.bz2 rsync-a64f19e24b476e622d15bffeb81ce57c426b6943.zip |
Fixed the backing up of a device or socket.
Diffstat (limited to 'backup.c')
-rw-r--r-- | backup.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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; |