summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2004-04-17 17:14:12 +0000
committerWayne Davison <wayned@samba.org>2004-04-17 17:14:12 +0000
commit4124540d61405c0de67a5c0f53c96eeae29fcaae (patch)
tree3f5a120c61a67c8b79f170c5697a5506d43214c8
parent5f3812681730713d0616badec608f632ebacb2ed (diff)
downloadrsync-4124540d61405c0de67a5c0f53c96eeae29fcaae.tar.gz
Changed the dev handling for -H back to using an opaque 64-bit
integer instead of trying to transfer it as separate major & minor values. Since the value is not interpreted by the receiving side (just compared for equality), this is a safer way to go.
-rw-r--r--flist.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/flist.c b/flist.c
index aa43235e..57355365 100644
--- a/flist.c
+++ b/flist.c
@@ -327,7 +327,8 @@ void send_file_entry(struct file_struct *file, int f, unsigned short base_flags)
unsigned short flags;
static time_t modtime;
static mode_t mode;
- static dev_t dev, rdev;
+ static uint64 dev;
+ static dev_t rdev;
static uint32 rdev_major;
static uid_t uid;
static gid_t gid;
@@ -341,7 +342,7 @@ void send_file_entry(struct file_struct *file, int f, unsigned short base_flags)
if (!file) {
write_byte(f, 0);
modtime = 0, mode = 0;
- dev = rdev = makedev(0, 0);
+ dev = 0, rdev = makedev(0, 0);
rdev_major = 0;
uid = 0, gid = 0;
*lastname = '\0';
@@ -478,20 +479,14 @@ void send_file_entry(struct file_struct *file, int f, unsigned short base_flags)
#if SUPPORT_HARD_LINKS
if (flags & XMIT_HAS_IDEV_DATA) {
- if (protocol_version >= 28) {
- /* major/minor dev_t and 64-bit ino_t */
- if (!(flags & XMIT_SAME_DEV)) {
- write_int(f, major(dev));
- write_int(f, minor(dev));
- }
- write_longint(f, file->F_INODE);
- } else if (protocol_version < 26) {
+ if (protocol_version < 26) {
/* 32-bit dev_t and ino_t */
write_int(f, dev);
write_int(f, file->F_INODE);
} else {
/* 64-bit dev_t and ino_t */
- write_longint(f, dev);
+ if (!(flags & XMIT_SAME_DEV))
+ write_longint(f, dev);
write_longint(f, file->F_INODE);
}
}
@@ -524,7 +519,8 @@ void receive_file_entry(struct file_struct **fptr, unsigned short flags,
{
static time_t modtime;
static mode_t mode;
- static dev_t dev, rdev;
+ static uint64 dev;
+ static dev_t rdev;
static uint32 rdev_major;
static uid_t uid;
static gid_t gid;
@@ -539,7 +535,7 @@ void receive_file_entry(struct file_struct **fptr, unsigned short flags,
if (!fptr) {
modtime = 0, mode = 0;
- dev = rdev = makedev(0, 0);
+ dev = 0, rdev = makedev(0, 0);
rdev_major = 0;
uid = 0, gid = 0;
*lastname = '\0';
@@ -677,19 +673,13 @@ void receive_file_entry(struct file_struct **fptr, unsigned short flags,
if (preserve_hard_links && protocol_version < 28 && S_ISREG(mode))
flags |= XMIT_HAS_IDEV_DATA;
if (flags & XMIT_HAS_IDEV_DATA) {
- INO64_T inode;
- if (protocol_version >= 28) {
- if (!(flags & XMIT_SAME_DEV)) {
- uint32 dev_major = read_int(f);
- uint32 dev_minor = read_int(f);
- dev = makedev(dev_major, dev_minor);
- }
- inode = read_longint(f);
- } else if (protocol_version < 26) {
- dev = (dev_t)read_int(f);
+ uint64 inode;
+ if (protocol_version < 26) {
+ dev = read_int(f);
inode = read_int(f);
} else {
- dev = (dev_t)read_longint(f);
+ if (!(flags & XMIT_SAME_DEV))
+ dev = read_longint(f);
inode = read_longint(f);
}
if (flist->hlink_pool) {