src.lock_maildirsize
changeset 11 203878d58792
parent 10 b4b103566960
child 13 311a14a1961e
equal deleted inserted replaced
10:b4b103566960 11:203878d58792
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent 68c3fb9c52b0af6e32558b20d60b34d0cc9daef4
     2 # Parent 148c0a8c561d4cc98dd473167fa50d2c59760400
     3 
     3 
     4 diff -r 68c3fb9c52b0 OS/Makefile-Linux
     4 diff -r 148c0a8c561d OS/Makefile-Linux
     5 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5 --- a/OS/Makefile-Linux	Thu Feb 24 17:15:25 2011 +0100
     6 +++ b/OS/Makefile-Linux	Thu Feb 24 10:42:47 2011 +0100
     6 +++ b/OS/Makefile-Linux	Thu Feb 24 17:17:37 2011 +0100
     7 @@ -0,0 +1,33 @@
     7 @@ -16,7 +16,7 @@
     8 +# $Cambridge: exim/src/OS/Makefile-Linux,v 1.4 2008/08/11 15:30:02 fanf2 Exp $
     8  DBMLIB = -ldb
     9 +
     9  USE_DB = yes
    10 +# Exim: OS-specific make file for Linux. This is for modern Linuxes,
    10  
    11 +# which use libc6.
    11 -LIBS = -lnsl -lcrypt -lm
    12 +
       
    13 +HAVE_ICONV=yes
       
    14 +
       
    15 +BASENAME_COMMAND=look_for_it
       
    16 +CHOWN_COMMAND=look_for_it
       
    17 +CHGRP_COMMAND=look_for_it
       
    18 +CHMOD_COMMAND=look_for_it
       
    19 +
       
    20 +CFLAGS=-O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
       
    21 +CFLAGS_DYNAMIC=-shared -rdynamic
       
    22 +
       
    23 +DBMLIB = -ldb
       
    24 +USE_DB = yes
       
    25 +
       
    26 +LIBS = -lnsl -lcrypt -lm -lrt
    12 +LIBS = -lnsl -lcrypt -lm -lrt
    27 +LIBRESOLV = -lresolv
    13  LIBRESOLV = -lresolv
    28 +
    14  
    29 +X11=/usr/X11R6
    15  X11=/usr/X11R6
    30 +XINCLUDE=-I$(X11)/include
    16 diff -r 148c0a8c561d src/transports/appendfile.c
    31 +XLFLAGS=-L$(X11)/lib
    17 --- a/src/transports/appendfile.c	Thu Feb 24 17:15:25 2011 +0100
    32 +X11_LD_LIB=$(X11)/lib
    18 +++ b/src/transports/appendfile.c	Thu Feb 24 17:17:37 2011 +0100
    33 +
       
    34 +EXIWHAT_PS_ARG=ax
       
    35 +EXIWHAT_EGREP_ARG='/exim( |$$)'
       
    36 +EXIWHAT_MULTIKILL_CMD=killall
       
    37 +EXIWHAT_MULTIKILL_ARG=exim
       
    38 +EXIWHAT_KILL_SIGNAL=-USR1
       
    39 +
       
    40 +# End
       
    41 diff -r 68c3fb9c52b0 src/transports/appendfile.c
       
    42 --- a/src/transports/appendfile.c	Thu Feb 24 10:39:43 2011 +0100
       
    43 +++ b/src/transports/appendfile.c	Thu Feb 24 10:42:47 2011 +0100
       
    44 @@ -13,6 +13,7 @@
    19 @@ -13,6 +13,7 @@
    45  
    20  
    46  #ifdef SUPPORT_MAILDIR
    21  #ifdef SUPPORT_MAILDIR
    47  #include "tf_maildir.h"
    22  #include "tf_maildir.h"
    48 +extern int lockfd;				/* from tf_maildir */	// hs12
    23 +extern int lockfd;				/* from tf_maildir */	// hs12
   158 +	(void)close(lockfd);
   133 +	(void)close(lockfd);
   159 +	}
   134 +	}
   160  
   135  
   161  #ifdef SUPPORT_MBX
   136  #ifdef SUPPORT_MBX
   162  if (mbx_lockfd >= 0)
   137  if (mbx_lockfd >= 0)
   163 diff -r 68c3fb9c52b0 src/transports/appendfile.h
   138 diff -r 148c0a8c561d src/transports/appendfile.h
   164 --- a/src/transports/appendfile.h	Thu Feb 24 10:39:43 2011 +0100
   139 --- a/src/transports/appendfile.h	Thu Feb 24 17:15:25 2011 +0100
   165 +++ b/src/transports/appendfile.h	Thu Feb 24 10:42:47 2011 +0100
   140 +++ b/src/transports/appendfile.h	Thu Feb 24 17:17:37 2011 +0100
   166 @@ -95,5 +95,8 @@
   141 @@ -95,5 +95,8 @@
   167  /* Function that is shared with tf_maildir.c */
   142  /* Function that is shared with tf_maildir.c */
   168  
   143  
   169  extern off_t  check_dir_size(uschar *, int *, const pcre *);
   144  extern off_t  check_dir_size(uschar *, int *, const pcre *);
   170 +extern int apply_lock(int fd, int fcntltype, BOOL dofcntl, int fcntltime, BOOL doflock,
   145 +extern int apply_lock(int fd, int fcntltype, BOOL dofcntl, int fcntltime, BOOL doflock,
   171 +    int flocktime);
   146 +    int flocktime);
   172 +
   147 +
   173  
   148  
   174  /* End of transports/appendfile.h */
   149  /* End of transports/appendfile.h */
   175 diff -r 68c3fb9c52b0 src/transports/tf_maildir.c
   150 diff -r 148c0a8c561d src/transports/tf_maildir.c
   176 --- a/src/transports/tf_maildir.c	Thu Feb 24 10:39:43 2011 +0100
   151 --- a/src/transports/tf_maildir.c	Thu Feb 24 17:15:25 2011 +0100
   177 +++ b/src/transports/tf_maildir.c	Thu Feb 24 10:42:47 2011 +0100
   152 +++ b/src/transports/tf_maildir.c	Thu Feb 24 17:17:37 2011 +0100
   178 @@ -367,13 +367,16 @@
   153 @@ -367,13 +367,16 @@
   179  
   154  
   180  Returns:           >=0  a file descriptor for an open maildirsize file
   155  Returns:           >=0  a file descriptor for an open maildirsize file
   181                     -1   there was an error opening or accessing the file
   156                     -1   there was an error opening or accessing the file
   182 +				        or locking
   157 +				        or locking
   297  /* Return the sizes and the file descriptor, if any */
   272  /* Return the sizes and the file descriptor, if any */
   298 -
   273 -
   299  DEBUG(D_transport) debug_printf("returning maildir size=" OFF_T_FMT
   274  DEBUG(D_transport) debug_printf("returning maildir size=" OFF_T_FMT
   300    " filecount=%d\n", size, filecount);
   275    " filecount=%d\n", size, filecount);
   301  *returned_size = size;
   276  *returned_size = size;
   302 diff -r 68c3fb9c52b0 src/transports/tf_maildir.h
       
   303 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   304 +++ b/src/transports/tf_maildir.h	Thu Feb 24 10:42:47 2011 +0100
       
   305 @@ -0,0 +1,22 @@
       
   306 +/* $Cambridge: exim/src/src/transports/tf_maildir.h,v 1.7 2009/11/16 19:56:54 nm4 Exp $ */
       
   307 +
       
   308 +/*************************************************
       
   309 +*     Exim - an Internet mail transport agent    *
       
   310 +*************************************************/
       
   311 +
       
   312 +/* Copyright (c) University of Cambridge 1995 - 2009 */
       
   313 +/* See the file NOTICE for conditions of use and distribution. */
       
   314 +
       
   315 +/* Header file for the functions that are used to support the use of
       
   316 +maildirsize files for quota handling in maildir directories. */
       
   317 +
       
   318 +extern off_t  maildir_compute_size(uschar *, int *, time_t *, const pcre *,
       
   319 +                const pcre *, BOOL);
       
   320 +extern BOOL   maildir_ensure_directories(uschar *, address_item *, BOOL, int,
       
   321 +                uschar *);
       
   322 +extern int    maildir_ensure_sizefile(uschar *,
       
   323 +                appendfile_transport_options_block *, const pcre *,
       
   324 +                const pcre *, off_t *, int *, uschar **);
       
   325 +extern void   maildir_record_length(int, int);
       
   326 +
       
   327 +/* End of tf_maildir.h */