Updated patches to work with the current trunk.
[rsync/rsync-patches.git] / preallocate.diff
index b285b38..042d983 100644 (file)
@@ -9,7 +9,7 @@ To use this patch, run these commands for a successful build:
     ./configure
     make
 
-based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
+based-on: a01e3b490eb36ccf9e704840e1b6683dab867550
 diff --git a/compat.c b/compat.c
 --- a/compat.c
 +++ b/compat.c
@@ -39,7 +39,7 @@ diff --git a/compat.c b/compat.c
 diff --git a/configure.in b/configure.in
 --- a/configure.in
 +++ b/configure.in
-@@ -583,13 +583,49 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
+@@ -589,13 +589,49 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
      setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
      seteuid strerror putenv iconv_open locale_charset nl_langinfo getxattr \
      extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
@@ -54,9 +54,9 @@ diff --git a/configure.in b/configure.in
 +dnl Preallocation stuff (also fallocate, posix_fallocate function tests above):
 +
 +AC_CACHE_CHECK([for useable fallocate],rsync_cv_have_fallocate,[
-+AC_TRY_LINK([#include <sys/syscall.h>
++AC_TRY_LINK([#include <fcntl.h>
 +#include <sys/types.h>],
-+[syscall(fallocate, 0, 0, 0, 0);],
++[fallocate(0, 0, 0, 0);],
 +rsync_cv_have_fallocate=yes,rsync_cv_have_fallocate=no)])
 +if test x"$rsync_cv_have_fallocate" = x"yes"; then
 +    AC_DEFINE(HAVE_FALLOCATE, 1, [Define to 1 if you have the fallocate function and it compiles and links without error])
@@ -65,7 +65,7 @@ diff --git a/configure.in b/configure.in
 +AC_CACHE_CHECK([for SYS_fallocate],rsync_cv_have_sys_fallocate,[
 +AC_TRY_COMPILE([#include <sys/syscall.h>
 +#include <sys/types.h>],
-+[syscall(SYS_fallocate, 0, 0, 0, 0);],
++[syscall(SYS_fallocate, 0, 0, (loff_t)0, (loff_t)0);],
 +rsync_cv_have_sys_fallocate=yes,rsync_cv_have_sys_fallocate=no)])
 +if test x"$rsync_cv_have_sys_fallocate" = x"yes"; then
 +    AC_DEFINE(HAVE_SYS_FALLOCATE, 1, [Define to 1 if you have the SYS_fallocate syscall number])
@@ -150,7 +150,7 @@ diff --git a/options.c b/options.c
    {"inplace",          0,  POPT_ARG_VAL,    &inplace, 1, 0, 0 },
    {"no-inplace",       0,  POPT_ARG_VAL,    &inplace, 0, 0, 0 },
    {"append",           0,  POPT_ARG_NONE,   0, OPT_APPEND, 0, 0 },
-@@ -2646,6 +2657,9 @@ void server_options(char **args, int *argc_p)
+@@ -2661,6 +2672,9 @@ void server_options(char **args, int *argc_p)
        else if (remove_source_files)
                args[ac++] = "--remove-sent-files";