[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha6-210-g12f57f9

Jeremy Allison jra at samba.org
Thu Jan 29 18:44:52 GMT 2009


The branch, master has been updated
       via  12f57f95b504af63634978e6faabb9a1859a4e82 (commit)
       via  3639e525a92c1c91dd8d6f9286f1da4a33ee7656 (commit)
       via  11f32204f8e6c5e90e8e242116d3f74808184884 (commit)
       via  f9926a4944171759cdd129ae07962765d658f711 (commit)
       via  bc84bd7b718e5cf46cbdc49557d2d18d544a2626 (commit)
      from  11163720e6f30e83f523c5009e1e60b5cf28cda6 (commit)

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


- Log -----------------------------------------------------------------
commit 12f57f95b504af63634978e6faabb9a1859a4e82
Author: Björn Jacke <bj at sernet.de>
Date:   Thu Jan 29 13:23:26 2009 +0100

    setting mtime setted atime on BSD systems, fix this

commit 3639e525a92c1c91dd8d6f9286f1da4a33ee7656
Author: Björn Jacke <bj at sernet.de>
Date:   Thu Jan 29 00:35:26 2009 +0100

    add AIX sub-second resolution timestamp support

commit 11f32204f8e6c5e90e8e242116d3f74808184884
Author: Björn Jacke <bj at sernet.de>
Date:   Thu Jan 29 00:33:19 2009 +0100

    add configure check for AIX style sub-second resolution support

commit f9926a4944171759cdd129ae07962765d658f711
Author: Björn Jacke <bj at sernet.de>
Date:   Thu Jan 29 00:20:00 2009 +0100

    rather cosmetic fix for failed birthtime configure checks

commit bc84bd7b718e5cf46cbdc49557d2d18d544a2626
Author: Björn Jacke <bj at sernet.de>
Date:   Thu Jan 29 00:17:12 2009 +0100

    give configure check "sub-second timestamps without struct timespec" a chance to succeed

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

Summary of changes:
 source3/configure.in |   52 ++++++++++++++++++++++++++++++++++++++++++++-----
 source3/lib/time.c   |   28 +++++++++++++++++++++++++-
 2 files changed, 72 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index 40130fb..f44fb9b 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1395,7 +1395,7 @@ if test x"$samba_cv_stat_hires" = x"yes" ; then
 	    [whether struct stat has sub-second timestamps])
 fi
 
-AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec], samba_cv_stat_hires_notimespec,
+AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec suffixed nsec], samba_cv_stat_hires_notimespec,
     [
 	AC_TRY_COMPILE(
 	    [
@@ -1423,7 +1423,7 @@ AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct tim
 		t.tv_sec = s.st_atime;
 		t.tv_nsec = s.st_atimensec;
 	    ],
-	    samba_cv_stat_hires=yes, samba_cv_stat_hires=no)
+	    samba_cv_stat_hires_notimespec=yes, samba_cv_stat_hires_notimespec=no)
     ])
 
 if test x"$samba_cv_stat_hires_notimespec" = x"yes" ; then
@@ -1431,7 +1431,47 @@ if test x"$samba_cv_stat_hires_notimespec" = x"yes" ; then
     AC_DEFINE(HAVE_STAT_ST_ATIMENSEC, 1, [whether struct stat contains st_atimensec])
     AC_DEFINE(HAVE_STAT_ST_CTIMENSEC, 1, [whether struct stat contains st_ctimensec])
     AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1,
-	    [whether struct stat has sub-second timestamps without struct timespec])
+	    [whether struct stat has sub-second timestamps without struct timespec suffixed nsec])
+fi
+
+dnl AIX stype sub-second timestamps:
+AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec suffixed _n], samba_cv_stat_hires_notimespec_n,
+    [
+	AC_TRY_COMPILE(
+	    [
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+	    ],
+	    [
+		struct timespec t;
+		struct stat s = {0};
+		t.tv_sec = s.st_mtime;
+		t.tv_nsec = s.st_mtime_n;
+		t.tv_sec = s.st_ctime;
+		t.tv_nsec = s.st_ctime_n;
+		t.tv_sec = s.st_atime;
+		t.tv_nsec = s.st_atime_n;
+	    ],
+	    samba_cv_stat_hires_notimespec_n=yes, samba_cv_stat_hires_notimespec_n=no)
+    ])
+
+if test x"$samba_cv_stat_hires_notimespec_n" = x"yes" ; then
+    AC_DEFINE(HAVE_STAT_ST_MTIME_N, 1, [whether struct stat contains st_mtime_n])
+    AC_DEFINE(HAVE_STAT_ST_ATIME_N, 1, [whether struct stat contains st_atime_n])
+    AC_DEFINE(HAVE_STAT_ST_CTIME_N, 1, [whether struct stat contains st_ctime_n])
+    AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1,
+	    [whether struct stat has sub-second timestamps without struct timespec suffixed _n])
 fi
 
 AC_CACHE_CHECK([whether struct stat has st_birthtimespec], samba_cv_stat_st_birthtimespec,
@@ -1457,7 +1497,7 @@ AC_CACHE_CHECK([whether struct stat has st_birthtimespec], samba_cv_stat_st_birt
 		struct stat s = {0};
 		t = s.st_birthtimespec;
 	    ],
-	    samba_cv_stat_st_birthtimespec=yes, samba_cv_stat_birthtimespec=no)
+	    samba_cv_stat_st_birthtimespec=yes, samba_cv_stat_st_birthtimespec=no)
     ])
 
 if test x"$samba_cv_stat_st_birthtimespec" = x"yes" ; then
@@ -1487,7 +1527,7 @@ AC_CACHE_CHECK([whether struct stat has st_birthtimensec], samba_cv_stat_st_birt
 		struct stat s = {0};
 		t.tv_nsec = s.st_birthtimensec;
 	    ],
-	    samba_cv_stat_st_birthtimensec=yes, samba_cv_stat_birthtimensec=no)
+	    samba_cv_stat_st_birthtimensec=yes, samba_cv_stat_st_birthtimensec=no)
     ])
 
 if test x"$samba_cv_stat_st_birthtimensec" = x"yes" ; then
@@ -1517,7 +1557,7 @@ AC_CACHE_CHECK([whether struct stat has st_birthtime], samba_cv_stat_st_birthtim
 		struct stat s = {0};
 		t = s.st_birthtime;
 	    ],
-	    samba_cv_stat_st_birthtime=yes, samba_cv_stat_birthtime=no)
+	    samba_cv_stat_st_birthtime=yes, samba_cv_stat_st_birthtime=no)
     ])
 
 if test x"$samba_cv_stat_st_birthtime" = x"yes" ; then
diff --git a/source3/lib/time.c b/source3/lib/time.c
index 7dd0da8..d3b8543 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -404,6 +404,11 @@ struct timespec get_atimespec(const SMB_STRUCT_STAT *pst)
 	ret.tv_sec = pst->st_atime;
 	ret.tv_nsec = pst->st_atimensec;
 	return ret;
+#elif defined(HAVE_STAT_ST_ATIME_N)
+	struct timespec ret;
+	ret.tv_sec = pst->st_atime;
+	ret.tv_nsec = pst->st_atime_n;
+	return ret;
 #elif defined(HAVE_STAT_ST_ATIMESPEC)
 	return pst->st_atimespec;
 #else
@@ -423,6 +428,9 @@ void set_atimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
 #elif defined(HAVE_STAT_ST_ATIMENSEC)
 	pst->st_atime = ts.tv_sec;
 	pst->st_atimensec = ts.tv_nsec
+#elif defined(HAVE_STAT_ST_ATIME_N)
+	pst->st_atime = ts.tv_sec;
+	pst->st_atime_n = ts.tv_nsec
 #elif defined(HAVE_STAT_ST_ATIMESPEC)
 	pst->st_atimespec = ts;
 #else
@@ -448,6 +456,11 @@ struct timespec get_mtimespec(const SMB_STRUCT_STAT *pst)
 	ret.tv_sec = pst->st_mtime;
 	ret.tv_nsec = pst->st_mtimensec;
 	return ret;
+#elif defined(HAVE_STAT_ST_MTIME_N)
+	struct timespec ret;
+	ret.tv_sec = pst->st_mtime;
+	ret.tv_nsec = pst->st_mtime_n;
+	return ret;
 #elif defined(HAVE_STAT_ST_MTIMESPEC)
 	return pst->st_mtimespec;
 #else
@@ -467,8 +480,11 @@ void set_mtimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
 #elif defined(HAVE_STAT_ST_MTIMENSEC)
 	pst->st_mtime = ts.tv_sec;
 	pst->st_mtimensec = ts.tv_nsec
-#elif defined(HAVE_STAT_ST_ATIMESPEC)
-	pst->st_atimespec = ts;
+#elif defined(HAVE_STAT_ST_MTIME_N)
+	pst->st_mtime = ts.tv_sec;
+	pst->st_mtime_n = ts.tv_nsec
+#elif defined(HAVE_STAT_ST_MTIMESPEC)
+	pst->st_mtimespec = ts;
 #else
 #error	CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT 
 #endif
@@ -492,6 +508,11 @@ struct timespec get_ctimespec(const SMB_STRUCT_STAT *pst)
 	ret.tv_sec = pst->st_ctime;
 	ret.tv_nsec = pst->st_ctimensec;
 	return ret;
+#elif defined(HAVE_STAT_ST_CTIME_N)
+	struct timespec ret;
+	ret.tv_sec = pst->st_ctime;
+	ret.tv_nsec = pst->st_ctime_n;
+	return ret;
 #elif defined(HAVE_STAT_ST_CTIMESPEC)
 	return pst->st_ctimespec;
 #else
@@ -511,6 +532,9 @@ void set_ctimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
 #elif defined(HAVE_STAT_ST_CTIMENSEC)
 	pst->st_ctime = ts.tv_sec;
 	pst->st_ctimensec = ts.tv_nsec
+#elif defined(HAVE_STAT_ST_CTIME_N)
+	pst->st_ctime = ts.tv_sec;
+	pst->st_ctime_n = ts.tv_nsec
 #elif defined(HAVE_STAT_ST_CTIMESPEC)
 	pst->st_ctimespec = ts;
 #else


-- 
Samba Shared Repository


More information about the samba-cvs mailing list