src.lock_maildirsize
changeset 15 f7b5502d9e0c
parent 14 6233ac1f9517
child 16 ae4ab6efa941
--- a/src.lock_maildirsize	Thu Feb 24 20:31:10 2011 +0100
+++ b/src.lock_maildirsize	Thu Feb 24 22:29:59 2011 +0100
@@ -1,21 +1,9 @@
 # HG changeset patch
-# Parent d242bf664878ef31577058ed193d7c04eb27f6d0
+# Parent 64ab3b6277037986519edb924069a75ba339de2a
 
-diff -r d242bf664878 OS/Makefile-Linux
---- a/OS/Makefile-Linux	Thu Feb 24 20:12:03 2011 +0100
-+++ b/OS/Makefile-Linux	Thu Feb 24 20:29:13 2011 +0100
-@@ -16,7 +16,7 @@
- DBMLIB = -ldb
- USE_DB = yes
- 
--LIBS = -lnsl -lcrypt -lm
-+LIBS = -lnsl -lcrypt -lm -lrt
- LIBRESOLV = -lresolv
- 
- X11=/usr/X11R6
-diff -r d242bf664878 src/transports/appendfile.c
---- a/src/transports/appendfile.c	Thu Feb 24 20:12:03 2011 +0100
-+++ b/src/transports/appendfile.c	Thu Feb 24 20:29:13 2011 +0100
+diff -r 64ab3b627703 src/transports/appendfile.c
+--- a/src/transports/appendfile.c	Thu Feb 24 20:29:56 2011 +0100
++++ b/src/transports/appendfile.c	Thu Feb 24 22:29:28 2011 +0100
 @@ -13,6 +13,7 @@
  
  #ifdef SUPPORT_MAILDIR
@@ -30,8 +18,8 @@
  
 +void hs12_lock(int fd, int type, const char* msg)
 +{
-+	struct timespec t0, t1;
-+	clock_gettime(CLOCK_REALTIME, &t0);
++	struct timeval t0, t1;
++	gettimeofday(&t0, NULL);
 +	const char *ltype =
 +			type == F_UNLCK ? "UNLOCK"
 +			: type == F_RDLCK ? "READ LOCK"
@@ -43,13 +31,13 @@
 +	(void)apply_lock(fd, type, 1, 120, 0, 0);
 +	if (type == F_UNLCK) return;
 +
-+	clock_gettime(CLOCK_REALTIME, &t1);
++	gettimeofday(&t1, NULL);
 +	t1.tv_sec -= t0.tv_sec;
-+	t1.tv_nsec -= t0.tv_nsec;
-+	if (t1.tv_nsec < 0) { t1.tv_sec--; t1.tv_nsec *= -1; }
++	t1.tv_usec -= t0.tv_usec;
++	if (t1.tv_usec < 0) { t1.tv_usec *= -1; t1.tv_sec--; }
 +	DEBUG(D_transport) 
-+		 debug_printf("%s: %s was waiting for %d.%09d seconds\n", 
-+			 ltype, msg, t1.tv_sec, t1.tv_nsec);
++		 debug_printf("%s: %s was waiting for %d.%06d seconds\n", 
++			 ltype, msg, t1.tv_sec, t1.tv_usec);
 +	return;
 +}
  
@@ -135,9 +123,9 @@
  
  #ifdef SUPPORT_MBX
  if (mbx_lockfd >= 0)
-diff -r d242bf664878 src/transports/appendfile.h
---- a/src/transports/appendfile.h	Thu Feb 24 20:12:03 2011 +0100
-+++ b/src/transports/appendfile.h	Thu Feb 24 20:29:13 2011 +0100
+diff -r 64ab3b627703 src/transports/appendfile.h
+--- a/src/transports/appendfile.h	Thu Feb 24 20:29:56 2011 +0100
++++ b/src/transports/appendfile.h	Thu Feb 24 22:29:28 2011 +0100
 @@ -95,5 +95,8 @@
  /* Function that is shared with tf_maildir.c */
  
@@ -147,9 +135,9 @@
 +
  
  /* End of transports/appendfile.h */
-diff -r d242bf664878 src/transports/tf_maildir.c
---- a/src/transports/tf_maildir.c	Thu Feb 24 20:12:03 2011 +0100
-+++ b/src/transports/tf_maildir.c	Thu Feb 24 20:29:13 2011 +0100
+diff -r 64ab3b627703 src/transports/tf_maildir.c
+--- a/src/transports/tf_maildir.c	Thu Feb 24 20:29:56 2011 +0100
++++ b/src/transports/tf_maildir.c	Thu Feb 24 22:29:28 2011 +0100
 @@ -367,13 +367,16 @@
  
  Returns:           >=0  a file descriptor for an open maildirsize file
@@ -270,9 +258,9 @@
  DEBUG(D_transport) debug_printf("returning maildir size=" OFF_T_FMT
    " filecount=%d\n", size, filecount);
  *returned_size = size;
-diff -r d242bf664878 src/transports/tf_maildir.h
---- a/src/transports/tf_maildir.h	Thu Feb 24 20:12:03 2011 +0100
-+++ b/src/transports/tf_maildir.h	Thu Feb 24 20:29:13 2011 +0100
+diff -r 64ab3b627703 src/transports/tf_maildir.h
+--- a/src/transports/tf_maildir.h	Thu Feb 24 20:29:56 2011 +0100
++++ b/src/transports/tf_maildir.h	Thu Feb 24 22:29:28 2011 +0100
 @@ -16,7 +16,7 @@
                  uschar *);
  extern int    maildir_ensure_sizefile(uschar *,