Some minor variable and flag cleanup.
authorWayne Davison <wayned@samba.org>
Sun, 30 Jan 2011 05:50:36 +0000 (21:50 -0800)
committerWayne Davison <wayned@samba.org>
Sun, 30 Jan 2011 06:01:37 +0000 (22:01 -0800)
flist.c
generator.c
log.c
rsync.c
rsync.h

diff --git a/flist.c b/flist.c
index 4a50583..60e0063 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -52,12 +52,9 @@ extern int preserve_devices;
 extern int preserve_specials;
 extern int delete_during;
 extern int missing_args;
-extern int uid_ndx;
-extern int gid_ndx;
 extern int eol_nulls;
 extern int relative_paths;
 extern int implied_dirs;
-extern int file_extra_cnt;
 extern int ignore_perishable;
 extern int non_perishable_cnt;
 extern int prune_empty_dirs;
@@ -3177,13 +3174,14 @@ char *f_name(const struct file_struct *f, char *fbuf)
  * of the dirname string, and also indicates that "dirname" is a MAXPATHLEN
  * buffer (the functions we call will append names onto the end, but the old
  * dir value will be restored on exit). */
-struct file_list *get_dirlist(char *dirname, int dlen, int ignore_filter_rules)
+struct file_list *get_dirlist(char *dirname, int dlen, int flags)
 {
        struct file_list *dirlist;
        char dirbuf[MAXPATHLEN];
        int save_recurse = recurse;
        int save_xfer_dirs = xfer_dirs;
        int save_prune_empty_dirs = prune_empty_dirs;
+       int senddir_fd = flags & GDL_IGNORE_FILTER_RULES ? -2 : -1;
 
        if (dlen < 0) {
                dlen = strlcpy(dirbuf, dirname, MAXPATHLEN);
@@ -3196,7 +3194,7 @@ struct file_list *get_dirlist(char *dirname, int dlen, int ignore_filter_rules)
 
        recurse = 0;
        xfer_dirs = 1;
-       send_directory(ignore_filter_rules ? -2 : -1, dirlist, dirname, dlen, FLAG_CONTENT_DIR);
+       send_directory(senddir_fd, dirlist, dirname, dlen, FLAG_CONTENT_DIR);
        xfer_dirs = save_xfer_dirs;
        recurse = save_recurse;
        if (INFO_GTE(PROGRESS, 1))
index 8fd4a19..f2c4233 100644 (file)
@@ -44,8 +44,6 @@ extern int preserve_hard_links;
 extern int preserve_executability;
 extern int preserve_perms;
 extern int preserve_times;
-extern int uid_ndx;
-extern int gid_ndx;
 extern int delete_mode;
 extern int delete_before;
 extern int delete_during;
@@ -1233,7 +1231,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
 
                if (need_fuzzy_dirlist && S_ISREG(file->mode)) {
                        strlcpy(fnamecmpbuf, dn, sizeof fnamecmpbuf);
-                       fuzzy_dirlist = get_dirlist(fnamecmpbuf, -1, 1);
+                       fuzzy_dirlist = get_dirlist(fnamecmpbuf, -1, GDL_IGNORE_FILTER_RULES);
                        need_fuzzy_dirlist = 0;
                }
 
diff --git a/log.c b/log.c
index 0f6f90c..f842e55 100644 (file)
--- a/log.c
+++ b/log.c
@@ -37,8 +37,6 @@ extern int protocol_version;
 extern int always_checksum;
 extern int preserve_times;
 extern int msgs2stderr;
-extern int uid_ndx;
-extern int gid_ndx;
 extern int stdout_format_has_i;
 extern int stdout_format_has_o_or_i;
 extern int logfile_format_has_i;
diff --git a/rsync.c b/rsync.c
index 17ce76a..24b9c75 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -41,8 +41,6 @@ extern int am_generator;
 extern int am_starting_up;
 extern int allow_8bit_chars;
 extern int protocol_version;
-extern int uid_ndx;
-extern int gid_ndx;
 extern int inc_recurse;
 extern int inplace;
 extern int flist_eof;
diff --git a/rsync.h b/rsync.h
index 1b73031..c0bfaa9 100644 (file)
--- a/rsync.h
+++ b/rsync.h
 
 /* These flags are passed to functions but not stored. */
 
-#define FLAG_DIVERT_DIRS (1<<16)/* sender */
+#define FLAG_DIVERT_DIRS (1<<16)   /* sender, but must be unique */
 
+/* These flags are for get_dirlist(). */
+#define GDL_IGNORE_FILTER_RULES (1<<0)
+
+/* Some helper macros for matching bits. */
 #define BITS_SET(val,bits) (((val) & (bits)) == (bits))
 #define BITS_SETnUNSET(val,onbits,offbits) (((val) & ((onbits)|(offbits))) == (onbits))
 #define BITS_EQUAL(b1,b2,mask) (((unsigned)(b1) & (unsigned)(mask)) \