[SCM] Samba Shared Repository - branch master updated

Björn Jacke bjacke at samba.org
Tue Dec 8 18:56:44 MST 2009


The branch, master has been updated
       via  fd58556... s3: keep subsecond times on cross-filesystem moves and don't follow links
       via  b617466... s3:configure: check for lutimes, futimes and futimens
      from  bd11ec4... Merge commit 'origin/master' into abartlet-devel

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fd5855608f2704fddf887e3424762d344dc93993
Author: Björn Jacke <bj at sernet.de>
Date:   Wed Dec 9 02:06:17 2009 +0100

    s3: keep subsecond times on cross-filesystem moves and don't follow links

commit b6174662df2d2b1a98ec89237c7cacf02024daef
Author: Björn Jacke <bj at sernet.de>
Date:   Wed Dec 9 02:04:23 2009 +0100

    s3:configure: check for lutimes, futimes and futimens

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

Summary of changes:
 source3/configure.in          |    2 +-
 source3/modules/vfs_default.c |   22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index c9bfaee..fc9e09b 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1066,7 +1066,7 @@ AC_CHECK_FUNCS(setenv strcasecmp fcvt fcvtl)
 AC_CHECK_FUNCS(syslog vsyslog timegm)
 AC_CHECK_FUNCS(setlocale nl_langinfo)
 AC_CHECK_FUNCS(nanosleep,,[AC_CHECK_LIB_EXT(rt, LIBS, nanosleep)])
-AC_CHECK_FUNCS(utimensat)
+AC_CHECK_FUNCS(lutimes futimes utimensat futimens)
 AC_CHECK_FUNCS(mlock munlock mlockall munlockall)
 AC_CHECK_FUNCS(memalign posix_memalign hstrerror)
 AC_CHECK_HEADERS(sys/mman.h)
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index ded4b1a..6e2a571 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -540,6 +540,27 @@ static int copy_reg(const char *source, const char *dest)
 		return -1;
 
 	/* Try to copy the old file's modtime and access time.  */
+#if defined(HAVE_UTIMENSAT)
+	{
+		struct timespec ts[2];
+
+		ts[0] = source_stats.st_ex_atime;
+		ts[1] = source_stats.st_ex_mtime;
+		utimensat(AT_FDCWD, dest, ts, AT_SYMLINK_NOFOLLOW);
+	}
+#elif defined(HAVE_UTIMES)
+	{
+		struct timeval tv[2];
+
+		tv[0] = convert_timespec_to_timeval(source_stats.st_ex_atime);
+		tv[1] = convert_timespec_to_timeval(source_stats.st_ex_mtime);
+#ifdef HAVE_LUTIMES
+		lutimes(dest, tv);
+#else
+		utimes(dest, tv);
+#endif
+	}
+#elif defined(HAVE_UTIME)
 	{
 		struct utimbuf tv;
 
@@ -547,6 +568,7 @@ static int copy_reg(const char *source, const char *dest)
 		tv.modtime = convert_timespec_to_time_t(source_stats.st_ex_mtime);
 		utime(dest, &tv);
 	}
+#endif
 
 	if (unlink (source) == -1)
 		return -1;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list