The branch, v3-2-stable has been updated via e0b8d1af1bef392b4b188ca3f8ea5066b6547433 (commit) via 36780b4e4f3e2d8ceac8c7121df1f9d973eb8d4f (commit) via d90f4f56fc93418121506caa215cab4d80fb6f7a (commit) via 3ad6389bb8c921a31fb8cfc22e509c1f4023eb9a (commit) via a88e491d1047a73909c9c6afd638c88a4bb4001e (commit) via 2c127c4636eec1e060b3cfd5876622e42e8eafdd (commit) via 23429e754a5583493380e63b0f19d24641bbefea (commit) via 37ec855659d83c9c3de8455d4839a7f6027afb90 (commit) from d98820b808581a1c585c8fc45335ccc28ca2888b (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable - Log ----------------------------------------------------------------- commit e0b8d1af1bef392b4b188ca3f8ea5066b6547433 Author: Günther Deschner <g...@samba.org> Date: Thu Jan 22 19:31:22 2009 +0100 s3-docs: fix typo in eventlogadm manpage. Guenther (cherry picked from commit fb7b92abc2bea4b3d91cdd896f02db88065a4b8f) (cherry picked from commit 0cc588ac53316299d2e1ff7d61947fd864d412f9) (cherry picked from commit a0d32cbc36a52bcd6b9b542919edee72ce95acdf) commit 36780b4e4f3e2d8ceac8c7121df1f9d973eb8d4f Author: Björn Jacke <b...@sernet.de> Date: Thu Jan 29 22:59:00 2009 +0100 add Tru64 sub-second resolution timestamp support (cherry picked from commit ce440096473d4db0e43f65ced6c2084a5bdbabc6) commit d90f4f56fc93418121506caa215cab4d80fb6f7a Author: Björn Jacke <b...@sernet.de> Date: Thu Jan 29 21:59:44 2009 +0100 add configure check for Tru64 sub-second timestamp resolution (cherry picked from commit bbfe82768add789a98ce3711fb5f378d19363401) commit 3ad6389bb8c921a31fb8cfc22e509c1f4023eb9a Author: Björn Jacke <b...@sernet.de> Date: Thu Jan 29 20:56:51 2009 +0100 add missing semicolons the fixed configure check led to a missing semicolon in the now activated BSD code. Then this error was even copypasted into the new AIX code. grrr (cherry picked from commit 5e4f6639e7ed96f3457177d203283c1c55ec52dd) commit a88e491d1047a73909c9c6afd638c88a4bb4001e Author: Jeremy Allison <j...@samba.org> Date: Thu Jan 29 10:47:02 2009 -0800 Following Björn JACKE's patch, unify the detection of the timespec code in configure.in, and the application of it in time.c Jeremy. (cherry picked from commit d7c7acee813b3cd9649b381a3e63c0be56e67d29) commit 2c127c4636eec1e060b3cfd5876622e42e8eafdd Author: Björn Jacke <b...@sernet.de> Date: Thu Jan 29 00:33:19 2009 +0100 add configure check for AIX style sub-second resolution support (cherry picked from commit e0381d6a173dcf64910ac597a10a3f0fa59ffe43) commit 23429e754a5583493380e63b0f19d24641bbefea Author: Björn Jacke <b...@sernet.de> Date: Thu Jan 29 00:20:00 2009 +0100 rather cosmetic fix for failed birthtime configure checks (cherry picked from commit ca155297bf932df6fd4a0ff223e5a7f1b8340f6b) commit 37ec855659d83c9c3de8455d4839a7f6027afb90 Author: Björn Jacke <b...@sernet.de> Date: Thu Jan 29 00:17:12 2009 +0100 give configure check "sub-second timestamps without struct timespec" a chance to succeed (cherry picked from commit 772dcc3b3703507af6baee090602a0ae8633fe2f) ----------------------------------------------------------------------- Summary of changes: docs-xml/manpages-3/eventlogadm.8.xml | 4 +- source/configure.in | 132 +++++++++++++++++++++++++++++++-- source/lib/time.c | 66 ++++++++++++++++- 3 files changed, 190 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/docs-xml/manpages-3/eventlogadm.8.xml b/docs-xml/manpages-3/eventlogadm.8.xml index 04ba022..51a066f 100644 --- a/docs-xml/manpages-3/eventlogadm.8.xml +++ b/docs-xml/manpages-3/eventlogadm.8.xml @@ -91,7 +91,7 @@ </term> <listitem><para> The <command>-o write</command> reads event log - records from standard input and writes them to theSamba + records from standard input and writes them to the Samba event log store named by EVENTLOG. </para> </listitem> </varlistentry> @@ -180,7 +180,7 @@ </para></listitem> <listitem><para> - <command>SRN</command> - he name of the machine on + <command>SRN</command> - The name of the machine on which the eventlog was generated. This is typically the host name. </para></listitem> diff --git a/source/configure.in b/source/configure.in index 08eb67d..257d2ad 100644 --- a/source/configure.in +++ b/source/configure.in @@ -1278,7 +1278,8 @@ fi ################################################# # Check whether struct stat has timestamps with sub-second resolution. -# At least IRIX and Solaris have these. +# At least IRIX and Solaris have these. FREEBSD does as well, +# but with different members # # We check that # all of st_mtim, st_atim and st_ctim exist @@ -1287,6 +1288,43 @@ fi # There is some conflicting standards weirdness about whether we should use # "struct timespec" or "timespec_t". Linux doesn't have timespec_t, so we # prefer struct timespec. +AC_CACHE_CHECK([whether struct stat has timespec timestamps], + samba_cv_stat_timespec_hires, + [ + 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 = s.st_mtimespec; + t = s.st_ctimespec; + t = s.st_atimespec; + ], + samba_cv_stat_timespec_hires=yes, samba_cv_stat_timespec_hires=no) + ]) + +if test x"$samba_cv_stat_timespec_hires" = x"yes" ; then + AC_DEFINE(HAVE_STAT_ST_MTIMESPEC, 1, [whether struct stat contains st_mtimepec]) + AC_DEFINE(HAVE_STAT_ST_ATIMESPEC, 1, [whether struct stat contains st_atimespec]) + AC_DEFINE(HAVE_STAT_ST_CTIMESPEC, 1, [whether struct stat contains st_ctimespec]) + AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1, [whether struct stat has sub-second timestamps]) +fi + + AC_CACHE_CHECK([whether struct stat has sub-second timestamps], samba_cv_stat_hires, [ @@ -1327,7 +1365,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( [ @@ -1355,7 +1393,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 @@ -1363,7 +1401,87 @@ 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 + +dnl Tru64 has _micro_second_ resolution: +AC_CACHE_CHECK([whether struct stat has sub-second timestamps in st_uXtime], samba_cv_stat_hires_uxtime, + [ + 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_umtime * 1000; + t.tv_sec = s.st_ctime; + t.tv_nsec = s.st_uctime * 1000; + t.tv_sec = s.st_atime; + t.tv_nsec = s.st_uatime * 1000; + ], + samba_cv_stat_hires_uxtime=yes, samba_cv_stat_hires_uxtime=no) + ]) + +if test x"$samba_cv_stat_hires_uxtime" = x"yes" ; then + AC_DEFINE(HAVE_STAT_ST_UMTIME, 1, [whether struct stat contains st_umtime]) + AC_DEFINE(HAVE_STAT_ST_UATIME, 1, [whether struct stat contains st_uatime]) + AC_DEFINE(HAVE_STAT_ST_UCTIME, 1, [whether struct stat contains st_uctime]) + AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1, + [whether struct stat has sub-second timestamps in st_uXtime]) fi AC_CACHE_CHECK([whether struct stat has st_birthtimespec], samba_cv_stat_st_birthtimespec, @@ -1389,7 +1507,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 @@ -1419,7 +1537,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 @@ -1449,7 +1567,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/source/lib/time.c b/source/lib/time.c index 425539c..5c4d951 100644 --- a/source/lib/time.c +++ b/source/lib/time.c @@ -903,6 +903,18 @@ 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_UATIME) + struct timespec ret; + ret.tv_sec = pst->st_atime; + ret.tv_nsec = pst->st_uatime * 1000; + return ret; +#elif defined(HAVE_STAT_ST_ATIMESPEC) + return pst->st_atimespec; #else #error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT #endif @@ -919,7 +931,15 @@ void set_atimespec(SMB_STRUCT_STAT *pst, struct timespec ts) pst->st_atim = ts; #elif defined(HAVE_STAT_ST_ATIMENSEC) pst->st_atime = ts.tv_sec; - pst->st_atimensec = ts.tv_nsec + 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_UATIME) + pst->st_atime = ts.tv_sec; + pst->st_uatime = ts.tv_nsec / 1000; +#elif defined(HAVE_STAT_ST_ATIMESPEC) + pst->st_atimespec = ts; #else #error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT #endif @@ -943,6 +963,18 @@ 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_UMTIME) + struct timespec ret; + ret.tv_sec = pst->st_mtime; + ret.tv_nsec = pst->st_umtime * 1000; + return ret; +#elif defined(HAVE_STAT_ST_MTIMESPEC) + return pst->st_mtimespec; #else #error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT #endif @@ -959,7 +991,15 @@ void set_mtimespec(SMB_STRUCT_STAT *pst, struct timespec ts) pst->st_mtim = ts; #elif defined(HAVE_STAT_ST_MTIMENSEC) pst->st_mtime = ts.tv_sec; - pst->st_mtimensec = ts.tv_nsec + pst->st_mtimensec = ts.tv_nsec; +#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_UMTIME) + pst->st_mtime = ts.tv_sec; + pst->st_umtime = ts.tv_nsec / 1000; +#elif defined(HAVE_STAT_ST_MTIMESPEC) + pst->st_mtimespec = ts; #else #error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT #endif @@ -983,6 +1023,18 @@ 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_UCTIME) + struct timespec ret; + ret.tv_sec = pst->st_ctime; + ret.tv_nsec = pst->st_uctime * 1000; + return ret; +#elif defined(HAVE_STAT_ST_CTIMESPEC) + return pst->st_ctimespec; #else #error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT #endif @@ -999,7 +1051,15 @@ void set_ctimespec(SMB_STRUCT_STAT *pst, struct timespec ts) pst->st_ctim = ts; #elif defined(HAVE_STAT_ST_CTIMENSEC) pst->st_ctime = ts.tv_sec; - pst->st_ctimensec = ts.tv_nsec + 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_UCTIME) + pst->st_ctime = ts.tv_sec; + pst->st_uctime = ts.tv_nsec / 1000; +#elif defined(HAVE_STAT_ST_CTIMESPEC) + pst->st_ctimespec = ts; #else #error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT #endif -- Samba Shared Repository