src.lock_maildirsize
changeset 18 cacfba0189d0
parent 17 b0076c5c7eec
child 24 053ea8d7305d
equal deleted inserted replaced
17:b0076c5c7eec 18:cacfba0189d0
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent 64ab3b6277037986519edb924069a75ba339de2a
     2 # Parent 3cbad740cf65b90cb75768c7784ac22a8ee7622d
     3 
     3 
     4 diff -r 64ab3b627703 src/transports/appendfile.c
     4 diff -r 3cbad740cf65 src/transports/appendfile.c
     5 --- a/src/transports/appendfile.c	Thu Feb 24 20:29:56 2011 +0100
     5 --- a/src/transports/appendfile.c	Fri Apr 01 14:06:51 2011 +0200
     6 +++ b/src/transports/appendfile.c	Sun Feb 27 21:51:22 2011 +0100
     6 +++ b/src/transports/appendfile.c	Fri Apr 01 14:06:51 2011 +0200
     7 @@ -13,6 +13,7 @@
     7 @@ -13,6 +13,7 @@
     8  
     8  
     9  #ifdef SUPPORT_MAILDIR
     9  #ifdef SUPPORT_MAILDIR
    10  #include "tf_maildir.h"
    10  #include "tf_maildir.h"
    11 +extern int lockfd;				/* from tf_maildir */	// hs12
    11 +extern int lockfd;				/* from tf_maildir */	// hs12
   125 +	(void)close(lockfd);
   125 +	(void)close(lockfd);
   126 +	}
   126 +	}
   127  
   127  
   128  #ifdef SUPPORT_MBX
   128  #ifdef SUPPORT_MBX
   129  if (mbx_lockfd >= 0)
   129  if (mbx_lockfd >= 0)
   130 diff -r 64ab3b627703 src/transports/appendfile.h
   130 diff -r 3cbad740cf65 src/transports/appendfile.h
   131 --- a/src/transports/appendfile.h	Thu Feb 24 20:29:56 2011 +0100
   131 --- a/src/transports/appendfile.h	Fri Apr 01 14:06:51 2011 +0200
   132 +++ b/src/transports/appendfile.h	Sun Feb 27 21:51:22 2011 +0100
   132 +++ b/src/transports/appendfile.h	Fri Apr 01 14:06:51 2011 +0200
   133 @@ -95,5 +95,8 @@
   133 @@ -95,5 +95,8 @@
   134  /* Function that is shared with tf_maildir.c */
   134  /* Function that is shared with tf_maildir.c */
   135  
   135  
   136  extern off_t  check_dir_size(uschar *, int *, const pcre *);
   136  extern off_t  check_dir_size(uschar *, int *, const pcre *);
   137 +extern int apply_lock(int fd, int fcntltype, BOOL dofcntl, int fcntltime, BOOL doflock,
   137 +extern int apply_lock(int fd, int fcntltype, BOOL dofcntl, int fcntltime, BOOL doflock,
   138 +    int flocktime);
   138 +    int flocktime);
   139 +
   139 +
   140  
   140  
   141  /* End of transports/appendfile.h */
   141  /* End of transports/appendfile.h */
   142 diff -r 64ab3b627703 src/transports/tf_maildir.c
   142 diff -r 3cbad740cf65 src/transports/tf_maildir.c
   143 --- a/src/transports/tf_maildir.c	Thu Feb 24 20:29:56 2011 +0100
   143 --- a/src/transports/tf_maildir.c	Fri Apr 01 14:06:51 2011 +0200
   144 +++ b/src/transports/tf_maildir.c	Sun Feb 27 21:51:22 2011 +0100
   144 +++ b/src/transports/tf_maildir.c	Fri Apr 01 14:06:51 2011 +0200
   145 @@ -367,13 +367,16 @@
   145 @@ -367,13 +367,16 @@
   146  
   146  
   147  Returns:           >=0  a file descriptor for an open maildirsize file
   147  Returns:           >=0  a file descriptor for an open maildirsize file
   148                     -1   there was an error opening or accessing the file
   148                     -1   there was an error opening or accessing the file
   149 +				        or locking
   149 +				        or locking
   246  /* Return the sizes and the file descriptor, if any */
   246  /* Return the sizes and the file descriptor, if any */
   247 -
   247 -
   248  DEBUG(D_transport) debug_printf("returning maildir size=" OFF_T_FMT
   248  DEBUG(D_transport) debug_printf("returning maildir size=" OFF_T_FMT
   249    " filecount=%d\n", size, filecount);
   249    " filecount=%d\n", size, filecount);
   250  *returned_size = size;
   250  *returned_size = size;
   251 diff -r 64ab3b627703 src/transports/tf_maildir.h
   251 diff -r 3cbad740cf65 src/transports/tf_maildir.h
   252 --- a/src/transports/tf_maildir.h	Thu Feb 24 20:29:56 2011 +0100
   252 --- a/src/transports/tf_maildir.h	Fri Apr 01 14:06:51 2011 +0200
   253 +++ b/src/transports/tf_maildir.h	Sun Feb 27 21:51:22 2011 +0100
   253 +++ b/src/transports/tf_maildir.h	Fri Apr 01 14:06:51 2011 +0200
   254 @@ -16,7 +16,7 @@
   254 @@ -16,7 +16,7 @@
   255                  uschar *);
   255                  uschar *);
   256  extern int    maildir_ensure_sizefile(uschar *,
   256  extern int    maildir_ensure_sizefile(uschar *,
   257                  appendfile_transport_options_block *, const pcre *,
   257                  appendfile_transport_options_block *, const pcre *,
   258 -                const pcre *, off_t *, int *);
   258 -                const pcre *, off_t *, int *);