Tweaking the license text a bit more.
[rsync/rsync.git] / flist.c
diff --git a/flist.c b/flist.c
index 7f165a9..e33cd58 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -7,8 +7,9 @@
  * Copyright (C) 2002-2007 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -708,7 +709,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
                 || (preserve_specials && IS_SPECIAL(mode))) {
                        uint32 *devp = F_RDEV_P(first);
                        rdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
-                       extra_len += 2 * EXTRA_LEN;
+                       extra_len += DEV_EXTRA_CNT * EXTRA_LEN;
                }
                if (preserve_links && S_ISLNK(mode))
                        linkname_len = strlen(F_SYMLINK(first)) + 1;
@@ -779,7 +780,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
                                rdev_minor = read_int(f);
                        rdev = MAKEDEV(rdev_major, rdev_minor);
                }
-               extra_len += 2 * EXTRA_LEN;
+               extra_len += DEV_EXTRA_CNT * EXTRA_LEN;
                file_length = 0;
        } else if (protocol_version < 28)
                rdev = MAKEDEV(0, 0);
@@ -827,7 +828,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
        if (inc_recurse && S_ISDIR(mode)) {
                if (one_file_system) {
                        /* Room to save the dir's device for -x */
-                       extra_len += 2 * EXTRA_LEN;
+                       extra_len += DEV_EXTRA_CNT * EXTRA_LEN;
                }
                pool = dir_flist->file_pool;
        } else
@@ -945,7 +946,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
 
        if (always_checksum && (S_ISREG(mode) || protocol_version < 28)) {
                if (S_ISREG(mode))
-                       bp = (char*)F_SUM(file);
+                       bp = F_SUM(file);
                else {
                        /* Prior to 28, we get a useless set of nulls. */
                        bp = tmp_sum;
@@ -1093,7 +1094,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                if (flist->prev && S_ISDIR(st.st_mode)
                 && flags & FLAG_DIVERT_DIRS) {
                        /* Room for parent/sibling/next-child info. */
-                       extra_len += 3 * EXTRA_LEN;
+                       extra_len += DIRNODE_EXTRA_CNT * EXTRA_LEN;
                        dir_count++;
                        pool = dir_flist->file_pool;
                } else
@@ -1239,14 +1240,14 @@ 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,
-                                         int flags, int filter_flags)
+                                         int flags, int filter_level)
 {
        struct file_struct *file;
 #if defined SUPPORT_ACLS || defined SUPPORT_XATTRS
        statx sx;
 #endif
 
-       file = make_file(fname, flist, stp, flags, filter_flags);
+       file = make_file(fname, flist, stp, flags, filter_level);
        if (!file)
                return NULL;
 
@@ -1393,7 +1394,7 @@ static void add_dirs_to_tree(int parent_ndx, struct file_list *from_flist,
        int i;
        int32 *dp = NULL;
        int32 *parent_dp = parent_ndx < 0 ? NULL
-                        : F_DIRNODE_P(dir_flist->sorted[parent_ndx]);
+                        : F_DIR_NODE_P(dir_flist->sorted[parent_ndx]);
 
        flist_expand(dir_flist, dir_cnt);
        dir_flist->sorted = dir_flist->files;
@@ -1418,7 +1419,7 @@ static void add_dirs_to_tree(int parent_ndx, struct file_list *from_flist,
                else
                        send_dir_ndx = dir_flist->used - 1;
 
-               dp = F_DIRNODE_P(file);
+               dp = F_DIR_NODE_P(file);
                DIR_PARENT(dp) = parent_ndx;
                DIR_FIRST_CHILD(dp) = -1;
        }
@@ -1440,7 +1441,7 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
        DIR *d;
        int divert_dirs = (flags & FLAG_DIVERT_DIRS) != 0;
        int start = flist->used;
-       int filter_flags = f == -2 ? SERVER_FILTERS : ALL_FILTERS;
+       int filter_level = f == -2 ? SERVER_FILTERS : ALL_FILTERS;
 
        assert(flist != NULL);
 
@@ -1469,7 +1470,7 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
                        continue;
                }
 
-               send_file_name(f, flist, fbuf, NULL, flags, filter_flags);
+               send_file_name(f, flist, fbuf, NULL, flags, filter_level);
        }
 
        fbuf[len] = '\0';
@@ -1541,7 +1542,7 @@ void send_extra_file_list(int f, int at_least)
                flist->parent_ndx = dir_ndx;
 
                send1extra(f, file, flist);
-               dp = F_DIRNODE_P(file);
+               dp = F_DIR_NODE_P(file);
 
                /* If there are any duplicate directory names that follow, we
                 * send all the dirs together in one file-list.  The dir_flist
@@ -1551,7 +1552,7 @@ void send_extra_file_list(int f, int at_least)
                        send_dir_ndx = dir_ndx;
                        file = dir_flist->sorted[dir_ndx];
                        send1extra(f, file, flist);
-                       dp = F_DIRNODE_P(file);
+                       dp = F_DIR_NODE_P(file);
                }
 
                write_byte(f, 0);
@@ -1594,7 +1595,7 @@ void send_extra_file_list(int f, int at_least)
                                }
                                send_dir_depth--;
                                file = dir_flist->sorted[send_dir_ndx];
-                               dp = F_DIRNODE_P(file);
+                               dp = F_DIR_NODE_P(file);
                        }
                        send_dir_ndx = DIR_NEXT_SIBLING(dp);
                }