Renamed flist_extra_cnt to file_extra_cnt.
authorWayne Davison <wayned@samba.org>
Mon, 18 Dec 2006 06:56:26 +0000 (06:56 +0000)
committerWayne Davison <wayned@samba.org>
Mon, 18 Dec 2006 06:56:26 +0000 (06:56 +0000)
compat.c
flist.c
rsync.h

index b090c2a..16a0264 100644 (file)
--- a/compat.c
+++ b/compat.c
@@ -23,7 +23,7 @@
 #include "rsync.h"
 
 int remote_protocol = 0;
-int flist_extra_cnt = 0; /* count of file-list extras that everyone gets */
+int file_extra_cnt = 0; /* count of file-list extras that everyone gets */
 
 extern int verbose;
 extern int am_server;
@@ -36,18 +36,20 @@ extern int checksum_seed;
 extern int basis_dir_cnt;
 extern int prune_empty_dirs;
 extern int protocol_version;
+extern int preserve_uid;
+extern int preserve_gid;
 extern char *dest_option;
 
 void setup_protocol(int f_out,int f_in)
 {
        if (am_sender)
-               flist_extra_cnt += PTR_EXTRA_LEN;
+               file_extra_cnt += PTR_EXTRA_LEN;
        else
-               flist_extra_cnt++;
+               file_extra_cnt++;
        if (preserve_uid)
-               preserve_uid = ++flist_extra_cnt;
+               preserve_uid = ++file_extra_cnt;
        if (preserve_gid)
-               preserve_gid = ++flist_extra_cnt;
+               preserve_gid = ++file_extra_cnt;
 
        if (remote_protocol == 0) {
                if (!read_batch)
diff --git a/flist.c b/flist.c
index 11d4b04..cfa9bea 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -49,7 +49,7 @@ extern int preserve_uid;
 extern int preserve_gid;
 extern int relative_paths;
 extern int implied_dirs;
-extern int flist_extra_cnt;
+extern int file_extra_cnt;
 extern int ignore_perishable;
 extern int non_perishable_cnt;
 extern int prune_empty_dirs;
@@ -312,7 +312,6 @@ void flist_expand(struct file_list *flist)
 
 static void send_file_entry(struct file_struct *file, int f, int ndx)
 {
-       unsigned short flags;
        static time_t modtime;
        static mode_t mode;
        static int64 dev;
@@ -324,6 +323,7 @@ static void send_file_entry(struct file_struct *file, int f, int ndx)
        char fname[MAXPATHLEN];
        int first_hlink_ndx = -1;
        int l1, l2;
+       int flags;
 
        f_name(file, fname);
 
@@ -499,7 +499,7 @@ static void send_file_entry(struct file_struct *file, int f, int ndx)
 }
 
 static struct file_struct *recv_file_entry(struct file_list *flist,
-                                          unsigned short flags, int f)
+                                          int flags, int f)
 {
        static time_t modtime;
        static mode_t mode;
@@ -515,7 +515,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
        char thisname[MAXPATHLEN];
        unsigned int l1 = 0, l2 = 0;
        int alloc_len, basename_len, dirname_len, linkname_len;
-       int extra_len = flist_extra_cnt * EXTRA_LEN;
+       int extra_len = file_extra_cnt * EXTRA_LEN;
        int first_hlink_ndx = -1;
        OFF_T file_length;
        char *basename, *dirname, *bp;
@@ -827,7 +827,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
        char thisname[MAXPATHLEN];
        char linkname[MAXPATHLEN];
        int alloc_len, basename_len, dirname_len, linkname_len;
-       int extra_len = flist_extra_cnt * EXTRA_LEN;
+       int extra_len = file_extra_cnt * EXTRA_LEN;
        char *basename, *dirname, *bp;
 
        if (!flist || !flist->count)    /* Ignore lastdir when invalid. */
@@ -1055,7 +1055,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
 /* Only called for temporary file_struct entries created by make_file(). */
 void unmake_file(struct file_struct *file)
 {
-       int extra_cnt = flist_extra_cnt + LEN64_BUMP(file);
+       int extra_cnt = file_extra_cnt + LEN64_BUMP(file);
 #if EXTRA_ROUNDING > 0
        if (extra_cnt & EXTRA_ROUNDING)
                extra_cnt = (extra_cnt | EXTRA_ROUNDING) + 1;
@@ -1065,7 +1065,7 @@ void unmake_file(struct file_struct *file)
 
 static struct file_struct *send_file_name(int f, struct file_list *flist,
                                          char *fname, STRUCT_STAT *stp,
-                                         unsigned short flags)
+                                         int flags)
 {
        struct file_struct *file;
 
@@ -1454,7 +1454,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
 struct file_list *recv_file_list(int f)
 {
        struct file_list *flist;
-       unsigned short flags;
+       int flags;
        int64 start_read;
 
        rprintf(FLOG, "receiving file list\n");
diff --git a/rsync.h b/rsync.h
index 4d1d873..3245565 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -548,7 +548,7 @@ struct file_struct {
        const char basename[1]; /* The basename (AKA filename) follows */
 };
 
-extern int flist_extra_cnt;
+extern int file_extra_cnt;
 extern int preserve_uid;
 extern int preserve_gid;
 
@@ -558,7 +558,7 @@ extern int preserve_gid;
 #define SUM_EXTRA_CNT ((MD4_SUM_LENGTH + EXTRA_LEN - 1) / EXTRA_LEN)
 
 #define REQ_EXTRA(f,ndx) ((union file_extras*)(f) - (ndx))
-#define OPT_EXTRA(f,bump) ((union file_extras*)(f) - flist_extra_cnt - 1 - (bump))
+#define OPT_EXTRA(f,bump) ((union file_extras*)(f) - file_extra_cnt - 1 - (bump))
 
 #define LEN64_BUMP(f) ((f)->flags & FLAG_LENGTH64 ? 1 : 0)
 #define HLINK_BUMP(f) (F_IS_HLINKED(f) ? 1 : 0)