From d1777690e9f7bbba14f5c77ef0b21cf2da539a91 Mon Sep 17 00:00:00 2001 From: unknown Date: Apr 21 2009 17:22:34 +0000 Subject: This commit was manufactured by cvs2git to create tag 'FedoraDirSvr_1_2_0_RC1'. --- diff --git a/configure b/configure index c4209b1..099f528 100755 --- a/configure +++ b/configure @@ -23381,7 +23381,7 @@ initdir=/rc.d # those with our 64 bit compiled product. perlexec='/usr/bin/env perl' case $host in - *-*-linux*) + i*86-*-linux*) cat >>confdefs.h <<\_ACEOF #define XP_UNIX 1 @@ -23414,18 +23414,12 @@ _ACEOF cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 +#define CPU_x86 _ACEOF - platform="linux" - # relative to sysconfdir - initdir=/rc.d/init.d - # do arch specific linux stuff here - case $host in - i*86-*-linux*) cat >>confdefs.h <<\_ACEOF -#define CPU_x86 +#define _GNU_SOURCE 1 _ACEOF @@ -23433,7 +23427,7 @@ cat >>confdefs.h <<\_ACEOF #define ATOMIC_64BIT_OPERATIONS 1 _ACEOF - echo "$as_me:$LINENO: checking whether __sync_add_and_fetch is declared" >&5 + echo "$as_me:$LINENO: checking whether __sync_add_and_fetch is declared" >&5 echo $ECHO_N "checking whether __sync_add_and_fetch is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl___sync_add_and_fetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -23505,8 +23499,41 @@ _ACEOF fi - ;; - x86_64-*-linux*) + platform="linux" + # relative to sysconfdir + initdir=/rc.d/init.d + ;; + x86_64-*-linux*) + +cat >>confdefs.h <<\_ACEOF +#define XP_UNIX 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define Linux 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define LINUX 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define LINUX2_0 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define LINUX2_2 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define LINUX2_4 1 +_ACEOF + cat >>confdefs.h <<\_ACEOF #define CPU_x86_64 @@ -23514,10 +23541,15 @@ _ACEOF cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF #define ATOMIC_64BIT_OPERATIONS 1 _ACEOF - echo "$as_me:$LINENO: checking whether __sync_add_and_fetch is declared" >&5 + echo "$as_me:$LINENO: checking whether __sync_add_and_fetch is declared" >&5 echo $ECHO_N "checking whether __sync_add_and_fetch is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl___sync_add_and_fetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -23589,8 +23621,9 @@ _ACEOF fi - ;; - esac + platform="linux" + # relative to sysconfdir + initdir=/rc.d/init.d ;; ia64-hp-hpux*) diff --git a/configure.ac b/configure.ac index 9626172..17b400b 100644 --- a/configure.ac +++ b/configure.ac @@ -296,30 +296,35 @@ initdir=/rc.d # those with our 64 bit compiled product. perlexec='/usr/bin/env perl' case $host in - *-*-linux*) + i*86-*-linux*) AC_DEFINE([XP_UNIX], [1], [UNIX]) AC_DEFINE([Linux], [1], [Linux]) AC_DEFINE([LINUX], [1], [Linux]) AC_DEFINE([LINUX2_0], [1], [Linux 2.0]) AC_DEFINE([LINUX2_2], [1], [Linux 2.2]) AC_DEFINE([LINUX2_4], [1], [Linux 2.4]) + AC_DEFINE([CPU_x86], [], [cpu type x86]) AC_DEFINE([_GNU_SOURCE], [1], [GNU Source]) + AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter]) + AC_CHECK_DECLS([__sync_add_and_fetch]) + platform="linux" + # relative to sysconfdir + initdir=/rc.d/init.d + ;; + x86_64-*-linux*) + AC_DEFINE([XP_UNIX], [1], [UNIX]) + AC_DEFINE([Linux], [1], [Linux]) + AC_DEFINE([LINUX], [1], [Linux]) + AC_DEFINE([LINUX2_0], [1], [Linux 2.0]) + AC_DEFINE([LINUX2_2], [1], [Linux 2.2]) + AC_DEFINE([LINUX2_4], [1], [Linux 2.4]) + AC_DEFINE([CPU_x86_64], [], [cpu type x86_64]) + AC_DEFINE([_GNU_SOURCE], [1], [GNU Source]) + AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter]) + AC_CHECK_DECLS([__sync_add_and_fetch]) platform="linux" # relative to sysconfdir initdir=/rc.d/init.d - # do arch specific linux stuff here - case $host in - i*86-*-linux*) - AC_DEFINE([CPU_x86], [], [cpu type x86]) - AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter]) - AC_CHECK_DECLS([__sync_add_and_fetch]) - ;; - x86_64-*-linux*) - AC_DEFINE([CPU_x86_64], [], [cpu type x86_64]) - AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter]) - AC_CHECK_DECLS([__sync_add_and_fetch]) - ;; - esac ;; ia64-hp-hpux*) AC_DEFINE([XP_UNIX], [1], [UNIX]) diff --git a/ldap/servers/slapd/log.c b/ldap/servers/slapd/log.c index 7241129..cb23748 100644 --- a/ldap/servers/slapd/log.c +++ b/ldap/servers/slapd/log.c @@ -124,7 +124,6 @@ static int log__audit_rotationinfof(char *pathname); static int log__extract_logheader (FILE *fp, long *f_ctime, PRInt64 *f_size); static int log__check_prevlogs (FILE *fp, char *filename); static PRInt64 log__getfilesize(LOGFD fp); -static PRInt64 log__getfilesize_with_filename(char *filename); static int log__enough_freespace(char *path); static int vslapd_log_error(LOGFD fp, char *subsystem, char *fmt, va_list ap, int locked ); @@ -2516,8 +2515,6 @@ log__fix_rotationinfof(char *pathname) int log_type_id; int rval = LOG_ERROR; char *p; - char *rotated_log = NULL; - int rotated_log_len = 0; /* rotation info file is broken; can't trust the contents */ time (&now); @@ -2560,10 +2557,6 @@ log__fix_rotationinfof(char *pathname) loginfo.log_audit_logchain = NULL; break; } - /* length of (pathname + .YYYYMMDD-hhmmss) - * pathname includes ".rotationinfo", but that's fine. */ - rotated_log_len = strlen(pathname) + 17; - rotated_log = (char *)slapi_ch_malloc(rotated_log_len); /* read the directory entries into a linked list */ for (dirent = PR_ReadDir(dirptr, dirflags); dirent ; dirent = PR_ReadDir(dirptr, dirflags)) { @@ -2596,24 +2589,21 @@ log__fix_rotationinfof(char *pathname) logp = (struct logfileinfo *) slapi_ch_malloc (sizeof (struct logfileinfo)); logp->l_ctime = log_reverse_convert_time(p); - - PR_snprintf(rotated_log, rotated_log_len, "%s/%s", - logsdir, dirent->name); switch (log_type_id) { case ERRORSLOG: - logp->l_size = log__getfilesize_with_filename(rotated_log); + logp->l_size = loginfo.log_error_maxlogsize; /* dummy */ logp->l_next = loginfo.log_error_logchain; loginfo.log_error_logchain = logp; loginfo.log_numof_error_logs++; break; case ACCESSLOG: - logp->l_size = log__getfilesize_with_filename(rotated_log); + logp->l_size = loginfo.log_access_maxlogsize; logp->l_next = loginfo.log_access_logchain; loginfo.log_access_logchain = logp; loginfo.log_numof_access_logs++; break; case AUDITLOG: - logp->l_size = log__getfilesize_with_filename(rotated_log); + logp->l_size =loginfo.log_audit_maxlogsize; logp->l_next = loginfo.log_audit_logchain; loginfo.log_audit_logchain = logp; loginfo.log_numof_audit_logs++; @@ -2626,7 +2616,6 @@ done: if (NULL != dirptr) PR_CloseDir(dirptr); slapi_ch_free_string(&logsdir); - slapi_ch_free_string(&rotated_log); return rval; } #undef ERRORSLOG @@ -2901,23 +2890,12 @@ log__getfilesize(LOGFD fp) static PRInt64 log__getfilesize(LOGFD fp) { - PRFileInfo64 info; - - if (PR_GetOpenFileInfo64 (fp, &info) == PR_FAILURE) { - return -1; - } - return (PRInt64)info.size; /* type of size is PROffset64 */ -} - -static PRInt64 -log__getfilesize_with_filename(char *filename) -{ - PRFileInfo64 info; + PRFileInfo info; - if (PR_GetFileInfo64 ((const char *)filename, &info) == PR_FAILURE) { + if (PR_GetOpenFileInfo (fp, &info) == PR_FAILURE) { return -1; } - return (PRInt64)info.size; /* type of size is PROffset64 */ + return (PRInt64)info.size; /* type of size is off_t */ } #endif @@ -4077,7 +4055,7 @@ log_reverse_convert_time(char *tbuf) } else { return 0; } - tm.tm_isdst = -1; + return mktime(&tm); } diff --git a/ldap/servers/slapd/slapi_counter.c b/ldap/servers/slapd/slapi_counter.c index 0f56c8a..c9930d5 100644 --- a/ldap/servers/slapd/slapi_counter.c +++ b/ldap/servers/slapd/slapi_counter.c @@ -53,7 +53,6 @@ PRUint64 _sparcv9_AtomicSub_il(PRUint64 *address, PRUint64 val); #endif #endif -#ifdef ATOMIC_64BIT_OPERATIONS #if defined LINUX && (defined CPU_x86 || !HAVE_DECL___SYNC_ADD_AND_FETCH) /* On systems that don't have the 64-bit GCC atomic builtins, we need to * implement our own atomic functions using inline assembly code. */ @@ -70,8 +69,6 @@ PRUint64 __sync_sub_and_fetch_8(PRUint64 *ptr, PRUint64 subval); #define __sync_add_and_fetch __sync_add_and_fetch_8 #define __sync_sub_and_fetch __sync_sub_and_fetch_8 #endif -#endif /* ATOMIC_64BIT_OPERATIONS */ - /* * Counter Structure @@ -431,7 +428,6 @@ PRUint64 slapi_counter_get_value(Slapi_Counter *counter) return value; } -#ifdef ATOMIC_64BIT_OPERATIONS #if defined LINUX && (defined CPU_x86 || !HAVE_DECL___SYNC_ADD_AND_FETCH) /* On systems that don't have the 64-bit GCC atomic builtins, we need to * implement our own atomic add and subtract functions using inline @@ -524,4 +520,3 @@ PRUint64 __sync_sub_and_fetch_8(PRUint64 *ptr, PRUint64 subval) return retval; } #endif /* LINUX && (defined CPU_x86 || !HAVE_DECL___SYNC_ADD_AND_FETCH) */ -#endif /* ATOMIC_64BIT_OPERATIONS */ diff --git a/ldap/servers/snmp/main.c b/ldap/servers/snmp/main.c index 89732fa..4e249f5 100644 --- a/ldap/servers/snmp/main.c +++ b/ldap/servers/snmp/main.c @@ -357,10 +357,10 @@ load_config(char *conf_path) } /* set the semaphore name */ - /* "/" + ".stats" + \0 = 8 */ - serv_p->stats_sem_name = malloc(strlen(p) + 8); + /* ".stats" + \0 = 7 */ + serv_p->stats_sem_name = malloc(strlen(p) + 7); if (serv_p->stats_sem_name != NULL) { - snprintf(serv_p->stats_sem_name, strlen(p) + 8, "/%s.stats", p); + snprintf(serv_p->stats_sem_name, strlen(p) + 7, "%s.stats", p); } else { printf("ldap-agent: malloc error processing config file\n"); error = 1; diff --git a/wrappers/initscript.in b/wrappers/initscript.in index 9a7835c..9223eba 100644 --- a/wrappers/initscript.in +++ b/wrappers/initscript.in @@ -312,7 +312,6 @@ status() { ret=3 fi done - exit $ret }