Changes included in OpenLDAP 1.2 Release Engineering
CVS Tag: OPENLDAP_REL_ENG_1_2
Added the MDBM to the ldbm backends (memory mapped dbm)
+ Fixed slapd to reap back-shell children processes
Updated README to require BerkeleyDB 2.7.5
Fixed incorrect schema check when objectclass is missing (ITS#204)
Build environment
#include <signal.h>
+#undef SIGNAL
#ifdef HAVE_SIGSET
#define SIGNAL sigset
#else
# endif
#endif
+#ifndef LDAP_SIGCHLD
+#ifdef SIGCHLD
+#define LDAP_SIGCHLD SIGCHLD
+#elif SIGCLD
+#define LDAP_SIGCHLD SIGCLD
+#endif
+#endif
+
#endif /* _AC_SIGNAL_H */
#include <stdio.h>
+#include <ac/errno.h>
#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
#include "slap.h"
#include "lutil.h" /* Get lutil_detach() */
+#ifdef LDAP_SIGCHLD
+static void wait4child( int sig );
+#endif
+
/*
* when more than one slapd is running on one machine, each one might have
* it's own LOCAL for syslogging and must have its own pid/args files
(void) SIGNAL( SIGTERM, slap_set_shutdown );
(void) SIGNAL( SIGINT, slap_set_shutdown );
(void) SIGNAL( SIGHUP, slap_set_shutdown );
+#ifdef LDAP_SIGCHLD
+ (void) SIGNAL( LDAP_SIGCHLD, wait4child );
+#endif
time( &starttime );
}
+#ifdef LDAP_SIGCHLD
+
+/*
+ * Catch and discard terminated child processes, to avoid zombies.
+ */
+
+static void
+wait4child( int sig )
+{
+ int save_errno = errno;
+
+#ifdef WNOHANG
+ errno = 0;
+#ifdef HAVE_WAITPID
+ while ( waitpid( (pid_t)-1, NULL, WNOHANG ) >= 0 || errno == EINTR )
+ ; /* NULL */
+#else
+ while ( wait3( NULL, WNOHANG, NULL ) >= 0 || errno == EINTR )
+ ; /* NULL */
+#endif
+#else
+ (void) wait( NULL );
+#endif
+ (void) SIGNAL( sig, wait4child );
+ errno = save_errno;
+}
+
+#endif /* SIGCHLD || SIGCLD */
+
+
#ifdef LOG_LOCAL4
/*