Updated patches to work with the current trunk.
[rsync/rsync-patches.git] / drop-cache.diff
index fcb15a9..be0f9eb 100644 (file)
@@ -63,12 +63,19 @@ Changes:
 * pass --drop-cache on to the remote server
 * make test works now
 
+To use this patch, run these commands for a successful build:
+
+    patch -p1 <patches/drop-cache.diff
+    ./configure                         (optional if already run)
+    make
+
 diff --git a/checksum.c b/checksum.c
+index 811b5b6..f1f51cb 100644
 --- a/checksum.c
 +++ b/checksum.c
-@@ -26,6 +26,10 @@ extern int protocol_version;
- int csum_length = SHORT_SUM_LENGTH; /* initial value */
+@@ -24,6 +24,10 @@
+ extern int checksum_seed;
+ extern int protocol_version;
  
 +#ifdef HAVE_POSIX_FADVISE64
 +#define close(fd) fadv_close(fd)
@@ -78,9 +85,10 @@ diff --git a/checksum.c b/checksum.c
    a simple 32 bit checksum that can be upadted from either end
    (inspired by Mark Adler's Adler-32 checksum)
 diff --git a/cleanup.c b/cleanup.c
+index 19ef072..84a6cf3 100644
 --- a/cleanup.c
 +++ b/cleanup.c
-@@ -46,7 +46,13 @@ void close_all(void)
+@@ -47,7 +47,13 @@ void close_all(void)
        int fd;
        int ret;
        STRUCT_STAT st;
@@ -95,21 +103,23 @@ diff --git a/cleanup.c b/cleanup.c
        for (fd = max_fd; fd >= 0; fd--) {
                if ((ret = do_fstat(fd, &st)) == 0) {
 diff --git a/configure.in b/configure.in
+index bc7d4a7..e9ff45a 100644
 --- a/configure.in
 +++ b/configure.in
-@@ -554,7 +554,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
-     strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \
+@@ -553,7 +553,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
      setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
      strerror putenv iconv_open locale_charset nl_langinfo getxattr \
--    extattr_get_link sigaction sigprocmask setattrlist)
-+    extattr_get_link sigaction sigprocmask setattrlist posix_fadvise64)
+     extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
+-    initgroups)
++    initgroups posix_fadvise64)
  
  dnl cygwin iconv.h defines iconv_open as libiconv_open
  if test x"$ac_cv_func_iconv_open" != x"yes"; then
 diff --git a/fileio.c b/fileio.c
+index 0faa619..0326fe8 100644
 --- a/fileio.c
 +++ b/fileio.c
-@@ -30,6 +30,12 @@ extern int sparse_files;
+@@ -31,6 +31,12 @@ extern int sparse_files;
  static char last_byte;
  static OFF_T sparse_seek = 0;
  
@@ -123,9 +133,10 @@ diff --git a/fileio.c b/fileio.c
  {
        int ret;
 diff --git a/generator.c b/generator.c
+index 12007a1..f0c7a91 100644
 --- a/generator.c
 +++ b/generator.c
-@@ -115,6 +115,10 @@ static int need_retouch_dir_times;
+@@ -112,6 +112,10 @@ static int need_retouch_dir_times;
  static int need_retouch_dir_perms;
  static const char *solo_file = NULL;
  
@@ -133,10 +144,11 @@ diff --git a/generator.c b/generator.c
 +#define close(fd) fadv_close(fd)
 +#endif
 +
- /* For calling delete_item() and delete_dir_contents(). */
- #define DEL_NO_UID_WRITE      (1<<0) /* file/dir has our uid w/o write perm */
- #define DEL_RECURSE           (1<<1) /* if dir, delete all contents */
+ enum nonregtype {
+     TYPE_DIR, TYPE_SPECIAL, TYPE_DEVICE, TYPE_SYMLINK
+ };
 diff --git a/options.c b/options.c
+index e7c6c61..ce55d8e 100644
 --- a/options.c
 +++ b/options.c
 @@ -60,6 +60,7 @@ int preserve_uid = 0;
@@ -147,7 +159,7 @@ diff --git a/options.c b/options.c
  int cvs_exclude = 0;
  int dry_run = 0;
  int do_xfers = 1;
-@@ -327,6 +328,9 @@ void usage(enum logcode F)
+@@ -670,6 +671,9 @@ void usage(enum logcode F)
    rprintf(F,"     --backup-dir=DIR        make backups into hierarchy based in DIR\n");
    rprintf(F,"     --suffix=SUFFIX         set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
    rprintf(F," -u, --update                skip files that are newer on the receiver\n");
@@ -157,7 +169,7 @@ diff --git a/options.c b/options.c
    rprintf(F,"     --inplace               update destination files in-place (SEE MAN PAGE)\n");
    rprintf(F,"     --append                append data onto shorter files\n");
    rprintf(F,"     --append-verify         like --append, but with old data in file checksum\n");
-@@ -535,6 +539,9 @@ static struct poptOption long_options[] = {
+@@ -891,6 +895,9 @@ static struct poptOption long_options[] = {
    {"no-one-file-system",'x',POPT_ARG_VAL,   &one_file_system, 0, 0, 0 },
    {"no-x",            'x', POPT_ARG_VAL,    &one_file_system, 0, 0, 0 },
    {"update",          'u', POPT_ARG_NONE,   &update_only, 0, 0, 0 },
@@ -167,7 +179,7 @@ diff --git a/options.c b/options.c
    {"existing",         0,  POPT_ARG_NONE,   &ignore_non_existing, 0, 0, 0 },
    {"ignore-non-existing",0,POPT_ARG_NONE,   &ignore_non_existing, 0, 0, 0 },
    {"ignore-existing",  0,  POPT_ARG_NONE,   &ignore_existing, 0, 0, 0 },
-@@ -1720,6 +1727,11 @@ void server_options(char **args, int *argc_p)
+@@ -2235,6 +2242,11 @@ void server_options(char **args, int *argc_p)
        if (!am_sender)
                args[ac++] = "--sender";
  
@@ -180,9 +192,10 @@ diff --git a/options.c b/options.c
        argstr[0] = '-';
  
 diff --git a/receiver.c b/receiver.c
+index 4325e30..a3da64e 100644
 --- a/receiver.c
 +++ b/receiver.c
-@@ -63,6 +63,10 @@ static flist_ndx_list batch_redo_list;
+@@ -64,6 +64,10 @@ static flist_ndx_list batch_redo_list;
  /* We're either updating the basis file or an identical copy: */
  static int updating_basis_or_equiv;
  
@@ -194,9 +207,10 @@ diff --git a/receiver.c b/receiver.c
   * get_tmpname() - create a tmp filename for a given filename
   *
 diff --git a/rsync.yo b/rsync.yo
+index 941f7a5..512aa6b 100644
 --- a/rsync.yo
 +++ b/rsync.yo
-@@ -356,6 +356,7 @@ to the detailed description below for a complete description.  verb(
+@@ -359,6 +359,7 @@ to the detailed description below for a complete description.  verb(
       --super                 receiver attempts super-user activities
       --fake-super            store/recover privileged attrs using xattrs
   -S, --sparse                handle sparse files efficiently
@@ -204,7 +218,7 @@ diff --git a/rsync.yo b/rsync.yo
   -n, --dry-run               perform a trial run with no changes made
   -W, --whole-file            copy files whole (w/o delta-xfer algorithm)
   -x, --one-file-system       don't cross filesystem boundaries
-@@ -1053,6 +1054,10 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
+@@ -1120,6 +1121,10 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
  filesystem. It doesn't seem to handle seeks over null regions
  correctly and ends up corrupting the files.
  
@@ -216,9 +230,10 @@ diff --git a/rsync.yo b/rsync.yo
  make any changes (and produces mostly the same output as a real run).  It
  is most commonly used in combination with the bf(-v, --verbose) and/or
 diff --git a/sender.c b/sender.c
+index bf8221d..9e23dbb 100644
 --- a/sender.c
 +++ b/sender.c
-@@ -46,6 +46,10 @@ extern int write_batch;
+@@ -45,6 +45,10 @@ extern int write_batch;
  extern struct stats stats;
  extern struct file_list *cur_flist, *first_flist, *dir_flist;
  
@@ -230,27 +245,29 @@ diff --git a/sender.c b/sender.c
   * @file
   *
 diff --git a/t_unsafe.c b/t_unsafe.c
+index 9ba0aaa..3cb55e9 100644
 --- a/t_unsafe.c
 +++ b/t_unsafe.c
-@@ -28,6 +28,7 @@ int am_root = 0;
+@@ -27,6 +27,7 @@ int dry_run = 0;
+ int am_root = 0;
  int read_only = 0;
  int list_only = 0;
- int verbose = 0;
 +int drop_cache = 0;
+ int human_readable = 0;
  int preserve_perms = 0;
  int preserve_executability = 0;
 diff --git a/util.c b/util.c
+index 0cafed6..06d8770 100644
 --- a/util.c
 +++ b/util.c
-@@ -26,6 +26,7 @@
- extern int verbose;
+@@ -27,6 +27,7 @@
  extern int dry_run;
  extern int module_id;
 +extern int drop_cache;
  extern int modify_window;
  extern int relative_paths;
- extern int human_readable;
+ extern int preserve_xattrs;
 @@ -42,6 +43,131 @@ char curr_dir[MAXPATHLEN];
  unsigned int curr_dir_len;
  int curr_dir_depth; /* This is only set for a sanitizing daemon. */