components/samba/mozldap/patches/ctime_r.patch
changeset 5219 006be2060ead
parent 5218 0fb1985a7cd5
child 5220 0f3235cb9d2c
equal deleted inserted replaced
5218:0fb1985a7cd5 5219:006be2060ead
     1 Developed inhouse, the patch is attached to bug https://bugzil.la/213606
       
     2 and I have sent email to [email protected]. Since the mozldap development
       
     3 does not seem to be rapid at the moment, we may need to keep this patch for
       
     4 some time.
       
     5 
       
     6 --- c-sdk/ldap/libraries/libldap/tmplout.c.orig	Mon Feb 10 17:35:04 2014
       
     7 +++ c-sdk/ldap/libraries/libldap/tmplout.c	Mon Feb 10 17:36:13 2014
       
     8 @@ -40,6 +40,8 @@
       
     9   * 
       
    10   */
       
    11  
       
    12 +#define	_POSIX_PTHREAD_SEMANTICS	/* for ctime_r() */
       
    13 +
       
    14  #include "ldap-int.h"
       
    15  #include "disptmpl.h"
       
    16  
       
    17 @@ -47,12 +49,6 @@
       
    18  #include <time.h> /* for struct tm and ctime */
       
    19  #endif
       
    20  
       
    21 -
       
    22 -/* This is totally lame, since it should be coming from time.h, but isn't. */
       
    23 -#if defined(SOLARIS) 
       
    24 -char *ctime_r(const time_t *, char *, int);
       
    25 -#endif
       
    26 -
       
    27  static int do_entry2text( LDAP *ld, char *buf, char *base, LDAPMessage *entry,
       
    28  	struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals,
       
    29  	writeptype writeproc, void *writeparm, char *eol, int rdncount,
       
    30 
       
    31 --- c-sdk/ldap/include/portable.h.orig	Fri Feb  7 16:24:43 2014
       
    32 +++ c-sdk/ldap/include/portable.h	Fri Feb  7 16:22:58 2014
       
    33 @@ -317,7 +317,8 @@
       
    34  	|| defined(OSF1V4) || defined(AIX) || defined(UnixWare) \
       
    35          || defined(hpux) || defined(HPUX11) || defined(NETBSD) \
       
    36          || defined(IRIX6) || defined(FREEBSD) || defined(VMS) \
       
    37 -        || defined(NTO) || defined(OPENBSD) || defined(DRAGONFLY)
       
    38 +        || defined(NTO) || defined(OPENBSD) || defined(DRAGONFLY) \
       
    39 +	|| defined(SOLARIS)
       
    40  #define NSLDAPI_CTIME( c, b, l )        ctime_r( c, b )
       
    41  #elif defined( OSF1V3 )
       
    42  #define NSLDAPI_CTIME( c, b, l )	(ctime_r( c, b, l ) ? NULL : b)