[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Sat Oct 15 18:34:04 UTC 2016


The branch, master has been updated
       via  d1a1fec Use S_BLKSIZE when multiplying st_blocks.
      from  f3873b3 Support --sparse combined with --preallocate or --inplace.

https://git.samba.org/?p=rsync.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit d1a1fec1340254926e17f5d83f848f7574286a33
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Oct 15 11:13:28 2016 -0700

    Use S_BLKSIZE when multiplying st_blocks.

-----------------------------------------------------------------------

Summary of changes:
 syscall.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/syscall.c b/syscall.c
index fa53b63..d89eacd 100644
--- a/syscall.c
+++ b/syscall.c
@@ -43,6 +43,16 @@ extern int preallocate_files;
 extern int preserve_perms;
 extern int preserve_executability;
 
+#ifndef S_BLKSIZE
+# if defined hpux || defined __hpux__ || defined __hpux
+#  define S_BLKSIZE 1024
+# elif defined _AIX && defined _I386
+#  define S_BLKSIZE 4096
+# else
+#  define S_BLKSIZE 512
+# endif
+#endif
+
 #define RETURN_ERROR_IF(x,e) \
 	do { \
 		if (x) { \
@@ -456,7 +466,7 @@ OFF_T do_fallocate(int fd, OFF_T offset, OFF_T length)
 		STRUCT_STAT st;
 		if (do_fstat(fd, &st) < 0)
 			return length;
-		return st.st_blocks * 512;
+		return st.st_blocks * S_BLKSIZE;
 	}
 	return 0;
 }


-- 
The rsync repository.



More information about the rsync-cvs mailing list