dovecot: Added CMP_ST_MTIME() and CMP_ST_CTIME() macros that com...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 20 01:56:46 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/2e6a977b1d6a
changeset: 5782:2e6a977b1d6a
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 20 01:07:30 2007 +0300
description:
Added CMP_ST_MTIME() and CMP_ST_CTIME() macros that compare also nanoseconds
if they're available.

diffstat:

1 file changed, 12 insertions(+)
src/lib/compat.h |   12 ++++++++++++

diffs (22 lines):

diff -r 67cc6420c4e6 -r 2e6a977b1d6a src/lib/compat.h
--- a/src/lib/compat.h	Tue Jun 19 18:39:16 2007 +0300
+++ b/src/lib/compat.h	Wed Jun 20 01:07:30 2007 +0300
@@ -61,6 +61,18 @@ typedef int socklen_t;
 #  define CMP_DEV_T(a, b) ((a) == (b))
 #else
 #  error I do not know how to compare dev_t
+#endif
+
+#ifdef HAVE_STAT_TV_NSEC
+#  define CMP_ST_MTIME(st1, st2) \
+	((st1)->st_mtime == (st2)->st_mtime && \
+	 (st1)->st_mtim.tv_nsec == (st2)->st_mtim.tv_nsec)
+#  define CMP_ST_CTIME(st1, st2) \
+	((st1)->st_ctime == (st2)->st_ctime && \
+	 (st1)->st_ctim.tv_nsec == (st2)->st_ctim.tv_nsec)
+#else
+#  define CMP_ST_MTIME(st1, st2) ((st1)->st_mtime == (st2)->st_mtime)
+#  define CMP_ST_CTIME(st1, st2) ((st1)->st_ctime == (st2)->st_ctime)
 #endif
 
 /* strcasecmp(), strncasecmp() */


More information about the dovecot-cvs mailing list