]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
handle hard links on systems with 16 bit ino_t
authorAndrew Tridgell <tridge@samba.org>
Fri, 17 Jul 1998 14:42:59 +0000 (14:42 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 17 Jul 1998 14:42:59 +0000 (14:42 +0000)
acconfig.h
configure.in
rsync.c
rsync.h

index c923a62477408de93f0cc86c1621e0782cb1b70d..a78fd797bc9057fdc6e166ab59462a422d03ab09 100644 (file)
@@ -7,3 +7,4 @@
 #undef HAVE_UTIMBUF
 #undef ino_t
 #undef HAVE_CONNECT
+#undef HAVE_SHORT_INO_T
index 2a0f59bd431148d2e6aed5709fcfb6dcd8a02373..281d6954f4315141906c1cd5d7ee22bc697c2d4b 100644 (file)
@@ -62,6 +62,14 @@ main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) retu
 echo yes;AC_DEFINE(HAVE_OFF64_T), 
 echo no)
 
+echo $ac_n "checking for short ino_t ... $ac_c"
+AC_TRY_RUN([#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+main() { if (sizeof(ino_t) < sizeof(unsigned int)) return 0; return 1; }],
+echo yes;AC_DEFINE(HAVE_SHORT_INO_T), 
+echo no)
+
 echo $ac_n "checking for unsigned char ... $ac_c"
 AC_TRY_RUN([#include <stdio.h>
 main() { char c; c=250; exit((c > 0)?0:1); }],
diff --git a/rsync.c b/rsync.c
index 5ce968c94744b6ecf1333e0650ebf4b6f471f6d6..5ca73e2b1a39a061f93a3078d0afaf425c4b0e8b 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;
 
diff --git a/rsync.h b/rsync.h
index b3d44725e9d6a71e46fb11b76b606d8eb83ebac6..b2945133a3a0c9e80021942c8a1479f3220bed53 100644 (file)
--- a/rsync.h
+++ b/rsync.h
 #define NO_INT64
 #endif
 
+#if HAVE_SHORT_INO_T
+#define INO_T uint32
+#else
+#define INO_T ino_t
+#endif
+
 #ifndef MIN
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #endif
@@ -284,7 +290,7 @@ struct file_struct {
        time_t modtime;
        OFF_T length;
        mode_t mode;
-       ino_t inode;
+       INO_T inode;
        dev_t dev;
        dev_t rdev;
        uid_t uid;
@@ -303,11 +309,11 @@ struct file_list {
 };
 
 struct sum_buf {
-  OFF_T offset;                        /* offset in file of this chunk */
-  int len;                     /* length of chunk of file */
-  int i;                       /* index of this chunk */
-  uint32 sum1;                 /* simple checksum */
-  char sum2[SUM_LENGTH];       /* checksum  */
+       OFF_T offset;           /* offset in file of this chunk */
+       int len;                /* length of chunk of file */
+       int i;                  /* index of this chunk */
+       uint32 sum1;            /* simple checksum */
+       char sum2[SUM_LENGTH];  /* checksum  */
 };
 
 struct sum_struct {