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 c923a62..a78fd79 100644 (file)
@@ -7,3 +7,4 @@
 #undef HAVE_UTIMBUF
 #undef ino_t
 #undef HAVE_CONNECT
+#undef HAVE_SHORT_INO_T
index 2a0f59b..281d695 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 5ce968c..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;
 
diff --git a/rsync.h b/rsync.h
index b3d4472..b294513 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 {