handle hard links on systems with 16 bit ino_t
[rsync/rsync.git] / rsync.c
diff --git a/rsync.c b/rsync.c
index 0ed4a58..5ca73e2 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -698,7 +698,7 @@ static void delete_one(struct file_struct *f)
 
 static struct delete_list {
        dev_t dev;
-       ino_t inode;
+       INO_T inode;
 } *delete_list;
 static int dlist_len, dlist_alloc_len;
 
@@ -855,7 +855,7 @@ static void finish_transfer(char *fname, char *fnametmp, struct file_struct *fil
                if (errno == EXDEV) {
                        /* rename failed on cross-filesystem link.  
                           Copy the file instead. */
-                       if (copy_file(fnametmp,fname, file->mode)) {
+                       if (copy_file(fnametmp,fname, file->mode & ACCESSPERMS)) {
                                rprintf(FERROR,"copy %s -> %s : %s\n",
                                        fnametmp,fname,strerror(errno));
                        } else {