From c29ee43dbdbdac279a1e3914b0fa02f1b34260e8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 17 Jul 1998 14:42:59 +0000 Subject: [PATCH] handle hard links on systems with 16 bit ino_t --- acconfig.h | 1 + configure.in | 8 ++++++++ rsync.c | 2 +- rsync.h | 18 ++++++++++++------ 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/acconfig.h b/acconfig.h index c923a624..a78fd797 100644 --- a/acconfig.h +++ b/acconfig.h @@ -7,3 +7,4 @@ #undef HAVE_UTIMBUF #undef ino_t #undef HAVE_CONNECT +#undef HAVE_SHORT_INO_T diff --git a/configure.in b/configure.in index 2a0f59bd..281d6954 100644 --- a/configure.in +++ b/configure.in @@ -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 +#include +#include +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 main() { char c; c=250; exit((c > 0)?0:1); }], diff --git a/rsync.c b/rsync.c index 5ce968c9..5ca73e2b 100644 --- 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 b3d44725..b2945133 100644 --- a/rsync.h +++ b/rsync.h @@ -259,6 +259,12 @@ #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 { -- 2.34.1