]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Moved ldap_ headers to include/ac or include/ldap
authorKurt Zeilenga <kurt@openldap.org>
Fri, 14 Aug 1998 05:50:03 +0000 (05:50 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 14 Aug 1998 05:50:03 +0000 (05:50 +0000)
39 files changed:
build/platforms/freebsd-gcc/Make-platform
build/platforms/linux-gcc/Make-platform
clients/fax500/main.c
clients/finger/main.c
clients/gopher/go500.c
clients/gopher/go500gw.c
clients/mail500/main.c
clients/rcpt500/main.c
clients/ud/main.c
clients/ud/util.c
include/lthread.h
libraries/liblthread/thread.c
servers/slapd/aclparse.c
servers/slapd/attr.c
servers/slapd/back-ldbm/dbcache.c
servers/slapd/charray.c
servers/slapd/connection.c
servers/slapd/daemon.c
servers/slapd/detach.c
servers/slapd/dn.c
servers/slapd/main.c
servers/slapd/phonetic.c
servers/slapd/result.c
servers/slapd/tools/centipede.c
servers/slapd/tools/ldbmcat.c
servers/slapd/tools/ldbmtest.c
servers/slapd/tools/ldif.c
servers/slapd/tools/ldif2id2children.c
servers/slapd/tools/ldif2id2entry.c
servers/slapd/tools/ldif2index.c
servers/slapd/tools/ldif2ldbm.c
servers/slapd/value.c
servers/slurpd/admin.c
servers/slurpd/args.c
servers/slurpd/detach.c
servers/slurpd/fm.c
servers/slurpd/main.c
servers/slurpd/replica.c
servers/slurpd/ri.c

index 895b32f2af7e0fbaab628022a6f008b596a33141..1d78ed72c2472297ee0cca361bbae7e50cace0ab 100644 (file)
@@ -11,6 +11,9 @@
 # -------------------------------------------------------------------------
 # you will probably not need to edit anything below this point
 # -------------------------------------------------------------------------
-CC     = gcc
+CC     = cc
 
 PLATFORMCFLAGS=        -Dfreebsd
+
+# uncomment this line if using for LDAP_CRYPT
+#PLATFORMLIBS= -lcrypt
index 45f382392111a3222e1118e76fa7828eddc4e677..5e2a39fc44379b1f7949df7956b9606150df5a4a 100644 (file)
@@ -15,3 +15,6 @@ CC    = gcc
 RANLIB = "ranlib"
 
 PLATFORMCFLAGS=        -Dlinux
+
+# uncomment this if -DLDAP_CRYPT is defined
+#PLATFORMLIBS= -lcrypt
index 7481d4980e860ec07b4756c89e0ff54d0f04ebef..af0870442c9776d36537b0fd59a593ae4ba147e6 100644 (file)
@@ -10,7 +10,7 @@
  * is provided ``as is'' without express or implied warranty.
  */
 
-
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
@@ -24,7 +24,7 @@
 #include <sys/socket.h>
 #include <sysexits.h>
 #include <ldapconfig.h>
-#include "portable.h"
+#include "bridge.h"
 
 #include "lber.h"
 #include "ldap.h"
index 38c8dfc7696b0a4e8e7c3dd4c08f888f8e12b8f3..092ce7e072f059b3d81937d37cc21181a5a45ee7 100644 (file)
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
 #include "lber.h"
 #include "ldap.h"
 #include "disptmpl.h"
 #include <stdio.h>
-#include <string.h>
+#include <ac/string.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/time.h>
 #include <netdb.h>
 #include <syslog.h>
 #include <sys/resource.h>
-#include <sys/wait.h>
+#include <ac/wait.h>
 #ifdef aix
 #include <sys/select.h>
 #endif /* aix */
 #include <signal.h>
-#include "portable.h"
+#include "bridge.h"
 #include "ldapconfig.h"
 
 #ifdef USE_SYSCONF
index 333787677a14ef869a5b8c13120d16681f44eec7..0a704d8fb860bb4c8af73541eea5cdafb26a80b2 100644 (file)
@@ -10,6 +10,7 @@
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
@@ -27,7 +28,7 @@
 #include <sys/select.h>
 #endif /* aix */
 #include <signal.h>
-#include "portable.h"
+#include "bridge.h"
 #include "ldapconfig.h"
 #include "lber.h"
 #include "ldap.h"
index 7f74fbf57c562e78dca41c33a5e9f4ac11a5c798..78a3846e4b73c1f3fa7805aeecf5e48851ffa81c 100644 (file)
@@ -10,6 +10,8 @@
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
+
 #include "lber.h"
 #include "ldap.h"
 #include "disptmpl.h"
@@ -30,7 +32,7 @@
 #ifdef aix
 #include <sys/select.h>
 #endif /* aix */
-#include "portable.h"
+#include "bridge.h"
 #include "ldapconfig.h"
 
 #ifdef USE_SYSCONF
index 5fdea962011536a366ef54fb7b72c77565e2acdc..edce8ce20b272e07b5ac1a292db959345bc69b47 100644 (file)
@@ -10,6 +10,7 @@
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
@@ -21,7 +22,7 @@
 #include <sys/resource.h>
 #include <sys/wait.h>
 #include <sysexits.h>
-#include "portable.h"
+#include "bridge.h"
 
 #include "lber.h"
 #include "ldap.h"
index 3e65ac233b6467731c569e486c1a6d2f8c901098..c3303568ded89b2f923376f1173d7c6f4417b53a 100644 (file)
@@ -6,13 +6,14 @@
  * All Rights Reserved
  */
 
+#include "portable.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <syslog.h>
 #include <string.h>
 #include <ctype.h>
 
-#include "portable.h"
+#include "bridge.h"
 #include "ldapconfig.h"
 #include "rcpt500.h"
 
index c0b70b2ceb808d8cc058f34727de512cfe29f36e..1635500c9fbbb42b5e3ff6278b2ededbcb1dbbbf 100644 (file)
@@ -35,7 +35,8 @@
 #include <termios.h>
 #endif /* defined( NeXT ) || defined( ultrix ) etc. */
 #endif /* !DOS */
-#if defined( aix ) || defined( __NetBSD__ )
+#if defined( aix ) || defined( __NetBSD__ ) \
+       || defined( __FreeBSD__ ) || defined( linux )
 #include <sys/ioctl.h>
 #endif /* aix || __NetBSD__ */
 #include <ctype.h>
index 18b694b9c442da89a094e631eb2ec5d212890937..ca5e3a83ad5d7050a73dac215b54165cc643a180 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <stdio.h>
 #include <signal.h>
-#include "ldap_string.h"
+#include <ac/string.h>
 #ifdef DOS
 #include <malloc.h>
 #endif
@@ -30,7 +30,7 @@
 #if !defined(DOS) && !defined(VMS)
 #include <sys/types.h>
 #endif
-
+#include "bridge.h"
 #ifdef USE_TERMIOS
 #include <termios.h>
 #else /* USE_TERMIOS */
@@ -38,8 +38,6 @@
 #endif /* USE_TERMIOS */
 #include "ud.h"
 
-#include "bridge.h"
-
 #if defined(VMS)
 #define getch getchar
 #endif
index d1b34d8ecfdd6ebf6d15d12cc8a7a80fe8d884f4..d712a5e59337fe74d66f2167002295bf095ca18c 100644 (file)
@@ -3,7 +3,40 @@
 #ifndef _LTHREAD_H
 #define _LTHREAD_H
 
-#if defined( THREAD_SUNOS4_LWP )
+#if defined ( THREAD_NEXT_CTHREADS )
+
+#define _THREAD
+
+#include <mach/cthreads.h>
+
+typedef cthread_fn_t   VFP;
+typedef int            pthread_attr_t;
+typedef cthread_t      pthread_t;
+
+/* default attr states */
+#define pthread_mutexattr_default      NULL
+#define pthread_condattr_default       NULL
+
+/* thread state - joinable or not */
+#define PTHREAD_CREATE_JOINABLE        0
+#define PTHREAD_CREATE_DETACHED        1
+/* thread scope - who is in scheduling pool */
+#define PTHREAD_SCOPE_PROCESS  0
+#define PTHREAD_SCOPE_SYSTEM   1
+
+/* mutex attributes and mutex type */
+typedef int    pthread_mutexattr_t;
+typedef struct mutex pthread_mutex_t;
+
+/* mutex and condition variable scope - process or system */
+#define PTHREAD_SHARE_PRIVATE  0
+#define PTHREAD_SHARE_PROCESS  1
+
+/* condition variable attributes and condition variable type */
+typedef int    pthread_condattr_t;
+typedef struct condition pthread_cond_t;
+
+#elif defined( THREAD_SUNOS4_LWP )
 /***********************************
  *                                 *
  * thread definitions for sunos4   *
@@ -127,6 +160,18 @@ typedef cond_t     pthread_cond_t;
 #define pthread_attr_setdetachstate( a, b ) \
                                        pthread_attr_setdetach_np( a, b )
 
+#else /* end dce pthreads */
+
+#if defined( POSIX_THREADS )
+
+#define _THREAD
+
+#include <pthread.h>
+
+#define pthread_mutexattr_default      NULL
+#define pthread_condattr_default       NULL
+
+#endif /* posix threads */
 #endif /* dce pthreads */
 #endif /* mit pthreads */
 #endif /* sunos5 */
index 89a85c70b44872819dda6da7b229cd9923323b94..f6e516f5059240cc6a8e484fefc5a8889fad8f65 100644 (file)
@@ -2,7 +2,157 @@
 #include <stdio.h>
 #include "lthread.h"
 
-#if defined( THREAD_SUNOS4_LWP )
+#if defined( THREAD_NEXT_CTHREADS )
+
+/***********************************************************************
+ *                                                                     *
+ * under NEXTSTEP or OPENSTEP use CThreads                             *
+ * lukeh@xedoc.com.au                                                  *
+ *                                                                     *
+ ***********************************************************************/
+
+int
+pthread_attr_init( pthread_attr_t *attr )
+{
+       *attr = 0;
+       return( 0 );
+}
+
+int
+pthread_attr_destroy( pthread_attr_t *attr )
+{
+       return( 0 );
+}
+
+int
+pthread_attr_getdetachstate( pthread_attr_t *attr, int *detachstate )
+{
+       *detachstate = *attr;
+       return( 0 );
+}
+
+int
+pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate )
+{
+       *attr = detachstate;
+       return( 0 );
+}
+
+/* ARGSUSED */
+int
+pthread_create(
+    pthread_t          *tid,
+    pthread_attr_t     attr,
+    VFP                        func,
+    void               *arg
+)
+{
+       *tid = cthread_fork(func, arg);
+        return ( *tid == NULL ? -1 : 0 );
+}
+
+void
+pthread_yield()
+{
+       cthread_yield();
+}
+
+void
+pthread_exit( any_t a )
+{
+       cthread_exit( a );
+}
+
+void
+pthread_join( pthread_t tid, int *pStatus )
+{
+       int status;
+       status = (int) cthread_join ( tid );
+       if (pStatus != NULL)
+               {
+               *pStatus = status;
+               }
+}
+
+/* ARGSUSED */
+void
+pthread_kill( pthread_t tid, int sig )
+{
+       return;
+}
+
+/* ARGSUSED */
+int
+pthread_mutex_init( pthread_mutex_t *mp, pthread_mutexattr_t *attr )
+{
+       mutex_init( mp );
+       mp->name = NULL;
+       return ( 0 );
+}
+
+int
+pthread_mutex_destroy( pthread_mutex_t *mp )
+{
+       mutex_clear( mp );
+       return ( 0 );
+}
+
+int
+pthread_mutex_lock( pthread_mutex_t *mp )
+{
+       mutex_lock( mp );
+       return ( 0 );
+}
+
+int
+pthread_mutex_unlock( pthread_mutex_t *mp )
+{
+       mutex_unlock( mp );
+       return ( 0 );
+}
+
+int
+pthread_mutex_trylock( pthread_mutex_t *mp )
+{
+       return mutex_try_lock( mp );
+}
+
+int
+pthread_cond_init( pthread_cond_t *cv, pthread_condattr_t *attr )
+{
+       condition_init( cv );
+       return( 0 );
+}
+
+int
+pthread_cond_destroy( pthread_cond_t *cv )
+{
+       condition_clear( cv );
+       return( 0 );
+}
+
+int
+pthread_cond_wait( pthread_cond_t *cv, pthread_mutex_t *mp )
+{
+       condition_wait( cv, mp );
+       return( 0 );
+}
+
+int
+pthread_cond_signal( pthread_cond_t *cv )
+{
+       condition_signal( cv );
+       return( 0 );
+}
+
+int
+pthread_cond_broadcast( pthread_cond_t *cv )
+{
+       condition_broadcast( cv );
+       return( 0 );
+}
+
+#elif defined( THREAD_SUNOS4_LWP )
 
 /***********************************************************************
  *                                                                     *
@@ -333,6 +483,16 @@ pthread_kill( pthread_t tid, int sig )
        kill( getpid(), sig );
 }
 
+#else
+
+#if defined ( POSIX_THREADS )
+
+void p_thread_yield( void )
+{
+       sched_yield();
+}
+
+#endif /* posix threads */
 #endif /* dce pthreads */
 #endif /* mit pthreads */
 #endif /* sunos5 lwp */
index 10fa6a07210cd7681b2599953df1ceabeee7d107..af6205c1d3824655522563e7f53b1d0bcdffaf91 100644 (file)
@@ -1,6 +1,6 @@
 /* acl.c - routines to parse and check acl's */
 
-
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
@@ -9,7 +9,7 @@
 #include <netdb.h>
 #include "regex.h"
 #include "slap.h"
-#include "portable.h"
+#include "bridge.h"
 
 extern Filter          *str2filter();
 extern char            *re_comp();
index 7686d94767df285a23ad73347ff036fc5f7e0853..9de884518b1bc04c49bd0ccac088cb63c6ddb0ce 100644 (file)
@@ -1,5 +1,6 @@
 /* attr.c - routines for dealing with attributes */
 
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
@@ -9,7 +10,7 @@
 #include <sys/socket.h>
 #include <sys/param.h>
 #include <sys/stat.h>
-#include "portable.h"
+#include "bridge.h"
 #include "slap.h"
 
 extern char    **charray_dup();
index c16c8b160dfdfe210188465c5e9f19fe74636ad4..45362173daf18b96f7d4444c06ab41d2bdb3241f 100644 (file)
@@ -1,5 +1,6 @@
 /* ldbmcache.c - maintain a cache of open ldbm files */
 
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <sys/time.h>
@@ -8,7 +9,7 @@
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <errno.h>
-#include "portable.h"
+#include "bridge.h"
 #include "slap.h"
 #include "ldapconfig.h"
 #include "back-ldbm.h"
index b731cf1e9021fe81d93ee6cc3b79e2dffdcdacfe..e3b4d37feb673e60821ed43169280dc15dc3e347 100644 (file)
@@ -107,12 +107,15 @@ charray_dup( char **a )
 }
 
 char **
-str2charray( char *str, char *brkstr )
+str2charray( char *str_in, char *brkstr )
 {
        char    **res;
        char    *s;
        int     i;
 
+       /* protect the input string from strtok */
+       char *str = strdup( str_in );
+
        i = 1;
        for ( s = str; *s; s++ ) {
                if ( strchr( brkstr, *s ) != NULL ) {
@@ -128,5 +131,6 @@ str2charray( char *str, char *brkstr )
        }
        res[i] = NULL;
 
+       free( str );
        return( res );
 }
index 5c3ebdf708f7307d78562dee2c30ceaf4f4e567d..7634d3545bf6ba5f5385c47f937cd22cc565ee2d 100644 (file)
@@ -1,3 +1,4 @@
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <sys/time.h>
@@ -5,7 +6,7 @@
 #include <sys/socket.h>
 #include <errno.h>
 #include <signal.h>
-#include "portable.h"
+#include "bridge.h"
 #include "slap.h"
 
 extern Operation       *op_add();
@@ -203,7 +204,7 @@ connection_activity(
 
        pthread_attr_init( &attr );
        pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
-       if ( pthread_create( &arg->co_op->o_tid, attr,
+       if ( pthread_create( &arg->co_op->o_tid, &attr,
            (void *) connection_operation, (void *) arg ) != 0 ) {
                Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 );
        } else {
index 161fb79cf0e2bf6ce67b05be0ff4d7efba0a67ab..5bb56bdcf6b5d96d590240267f3152e714a15bd2 100644 (file)
@@ -1,3 +1,11 @@
+
+/* Revision history
+ *
+ * 5-Jun-96    hodges
+ *     Added locking of new_conn_mutex when traversing the c[] array.
+ */
+
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
@@ -12,7 +20,7 @@
 #include <sys/select.h>
 #endif
 #include "slap.h"
-#include "portable.h"
+#include "bridge.h"
 #include "ldapconfig.h"
 #ifdef NEED_FILIO
 #include <sys/filio.h>
@@ -48,7 +56,7 @@ static void   set_shutdown();
 static void    do_nothing();
 
 void
-daemon(
+slapd_daemon(
     int        port
 )
 {
@@ -68,7 +76,12 @@ daemon(
 #else /* USE_SYSCONF */
         dtblsize = getdtablesize();
 #endif /* USE_SYSCONF */
-
+       /*
+        * Add greg@greg.rim.or.jp
+        */
+       if(dtblsize > FD_SETSIZE) {
+               dtblsize = FD_SETSIZE;
+       }
        c = (Connection *) ch_calloc( 1, dtblsize * sizeof(Connection) );
 
        for ( i = 0; i < dtblsize; i++ ) {
@@ -127,9 +140,18 @@ daemon(
        }
 
        (void) SIGNAL( SIGPIPE, SIG_IGN );
+#ifdef SIGSTKFLT
+       (void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
+#else
        (void) SIGNAL( SIGUSR1, (void *) do_nothing );
+#endif
+#ifdef SIGSTKFLT
+       (void) SIGNAL( SIGUNUSED, (void *) set_shutdown );
+#else
        (void) SIGNAL( SIGUSR2, (void *) set_shutdown );
+#endif
        (void) SIGNAL( SIGTERM, (void *) set_shutdown );
+       (void) SIGNAL( SIGINT, (void *) set_shutdown );
        (void) SIGNAL( SIGHUP, (void *) set_shutdown );
 
        Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 );
@@ -164,6 +186,8 @@ daemon(
                Debug( LDAP_DEBUG_CONNS,
                    "listening for connections on %d, activity on:",
                    tcps, 0, 0 );
+
+               pthread_mutex_lock( &new_conn_mutex );
                for ( i = 0; i < dtblsize; i++ ) {
                        if ( c[i].c_sb.sb_sd != -1 ) {
                                FD_SET( c[i].c_sb.sb_sd, &readfds );
@@ -176,6 +200,7 @@ daemon(
                        }
                }
                Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 );
+               pthread_mutex_unlock( &new_conn_mutex );
 
                zero.tv_sec = 0;
                zero.tv_usec = 0;
@@ -349,15 +374,28 @@ set_shutdown()
 {
        Debug( LDAP_DEBUG_ANY, "slapd got shutdown signal\n", 0, 0, 0 );
        slapd_shutdown = 1;
+#ifdef SIGSTKFLT
+       pthread_kill( listener_tid, SIGSTKFLT );
+#else
        pthread_kill( listener_tid, SIGUSR1 );
+#endif
+#ifdef SIGUNUSED
+       (void) SIGNAL( SIGUNUSED, (void *) set_shutdown );
+#else
        (void) SIGNAL( SIGUSR2, (void *) set_shutdown );
+#endif
        (void) SIGNAL( SIGTERM, (void *) set_shutdown );
+       (void) SIGNAL( SIGINT, (void *) set_shutdown );
        (void) SIGNAL( SIGHUP, (void *) set_shutdown );
 }
 
 static void
 do_nothing()
 {
-       Debug( LDAP_DEBUG_TRACE, "slapd got SIGUSR1\n", 0, 0, 0 );
+       Debug( LDAP_DEBUG_TRACE, "slapd got do_nothing signal\n", 0, 0, 0 );
+#ifdef SIGSTKFLT
+       (void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
+#else
        (void) SIGNAL( SIGUSR1, (void *) do_nothing );
+#endif
 }
index 7b3fdab57ae97fc181fae0452a6ee4c3cd04b1de..dcd723b79f8473bc2316847f9efdf388c35ba4a4 100644 (file)
@@ -10,6 +10,7 @@
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
 #include <stdio.h>
 #include <sys/types.h>
 #ifdef SVR4
@@ -19,7 +20,7 @@
 #include <sys/file.h>
 #include <sys/ioctl.h>
 #include <signal.h>
-#include "portable.h"
+#include "bridge.h"
 
 #ifdef USE_SYSCONF
 #include <unistd.h>
index 226937efa99f521a9c0cf0d6ef98deeb631f7fe7..d18c15f0a0b06da6e9c1e615065f788df16325f4 100644 (file)
@@ -1,12 +1,13 @@
 /* dn.c - routines for dealing with distinguished names */
 
+#include "portable.h"
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include "portable.h"
+#include "bridge.h"
 #include "slap.h"
 
 static char    **dn_explode();
index 01930b970910c9c1ad6cd9a8bf6939af58baed05..4f0b8741317203e1ef0383c40a79f7f42a97fcd6 100644 (file)
@@ -1,3 +1,4 @@
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
@@ -6,11 +7,11 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
-#include "portable.h"
+#include "bridge.h"
 #include "slap.h"
 #include "ldapconfig.h"
 
-extern void    daemon();
+extern void    slapd_daemon();
 extern int     lber_debug;
 
 extern char Versionstr[];
@@ -184,7 +185,7 @@ main( argc, argv )
                pthread_attr_init( &attr );
                pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
 
-               if ( pthread_create( &listener_tid, attr, (void *) daemon,
+               if ( pthread_create( &listener_tid, &attr, (void *) slapd_daemon,
                    (void *) port ) != 0 ) {
                        Debug( LDAP_DEBUG_ANY,
                            "listener pthread_create failed\n", 0, 0, 0 );
index 959e06e1e332479aeae05f92dcd4d8c2ce8f4f13..1117026f0778ecc91ea118e8a75106d86fdbcb16 100644 (file)
@@ -1,12 +1,13 @@
 /* phonetic.c - routines to do phonetic matching */
 
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include "portable.h"
+#include "bridge.h"
 #include "slap.h"
 
 #if !defined(METAPHONE) && !defined(SOUNDEX)
index 0ef82a7b3e36e03f85a4a71a91040153fe182064..90b6dbe68ddd970becb5683f0bf8a1bfc526ab52 100644 (file)
@@ -1,5 +1,6 @@
 /* result.c - routines to send ldap results, errors, and referrals */
 
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <sys/time.h>
@@ -8,7 +9,7 @@
 #include <netinet/in.h>
 #include <errno.h>
 #include <signal.h>
-#include "portable.h"
+#include "bridge.h"
 #include "slap.h"
 
 #ifndef SYSERRLIST_IN_STDIO
@@ -121,7 +122,11 @@ send_ldap_result2(
                pthread_mutex_lock( &active_threads_mutex );
                active_threads--;
                conn->c_writewaiter = 1;
+#ifdef SIGSTKFLT
+               pthread_kill( listener_tid, SIGSTKFLT );
+#else
                pthread_kill( listener_tid, SIGUSR1 );
+#endif
                pthread_cond_wait( &conn->c_wcv, &active_threads_mutex );
                pthread_mutex_unlock( &active_threads_mutex );
 
index 4f0546d171bfa908a184862d68df1b524ded5952..97ee1b3e4649176999a46a6c43f44879205b0942 100644 (file)
@@ -3,9 +3,9 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include "ldap_string.h"
+#include <ac/string.h>
 #include <ctype.h>
-#include "ldap_time.h"
+#include <ac/time.h>
 
 #include <lber.h>
 #include <ldap.h>
index e9d70ba5bd0711019987877bc122392d4f6d58ac..46aae303367f68cc9c7fc9d24b9be6291e930140 100644 (file)
@@ -1,7 +1,7 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include "ldap_string.h"
+#include <ac/string.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/socket.h>
index 5dd55f392f3b1269b98dd127eda0759d3c83f06e..d7908b78ade16c89074a12419e731fee42a21604 100644 (file)
@@ -6,9 +6,9 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include "ldap_time.h"
+#include <ac/time.h>
 #include <sys/resource.h>
-#include "ldap_wait.h"
+#include <ac/wait.h>
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <limits.h>
index 456433bdf489538b5dc26dc0a4eb13348570794c..d480a2e7dd3e79447734b43137acb07aaf3418fc 100644 (file)
@@ -1,7 +1,7 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include "ldap_string.h"
+#include <ac/string.h>
 #include <memory.h>
 #include <sys/types.h>
 #include <sys/socket.h>
index f8a1aef52bd920e6273766e311b095d461f0af9b..4c79722b4f2d2deb238168cf909cc23aa967144e 100644 (file)
@@ -1,7 +1,7 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include "ldap_string.h"
+#include <ac/string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include "../slap.h"
index 3010d1d58ccc7d847801a474f968005bced3edab..ca315c3f7f9a11f6b7150f102e1a8ac6b3285e16 100644 (file)
@@ -1,7 +1,7 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include "ldap_string.h"
+#include <ac/string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include "../slap.h"
index 71318e0292d3cf7bab514fd1b233e0803faaedc9..87a1f71caf55377c816ed8d726f8c9f24508fb89 100644 (file)
@@ -1,7 +1,7 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include "ldap_string.h"
+#include <ac/string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include "../slap.h"
index 56531b4fbc2f95b20b4416741bde5e40e8f7b865..d6e2b6924e1bb624d8e3912c238d88f6b2dcdc4a 100644 (file)
@@ -1,6 +1,6 @@
 #include "portable.h"
 #include <stdio.h>
-#include "ldap_string.h"
+#include <ac/string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/param.h>
index c9e6fbb5774a1560f88990c63cab8a1e528fed5b..68b81283de4c58b063da83b65247cdad62099dab 100644 (file)
@@ -1,12 +1,13 @@
 /* value.c - routines for dealing with values */
 
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
-#include "portable.h"
+#include "bridge.h"
 #include "slap.h"
 
 int
index 6a58b40c4c34f044f7072fc9dea3faf174b47469..d1aed00cbf776370626930cc92e68940a1eda275 100644 (file)
  */
 
 
+#include "portable.h"
+
 #include <stdio.h>
 #include <signal.h>
 
 #include "slurp.h"
 #include "globals.h"
 
+#include "bridge.h"
 
 /*
  * Eventually, do_admin will be the entry point for performing
index b3cc935df8ece477c1cfc25ea772f6124906ba1e..dacf17fffaad6ac1b2c088f43e5841a227e83609 100644 (file)
@@ -14,6 +14,8 @@
  * args.c - process command-line arguments, and set appropriate globals.
  */
 
+#include "portable.h"
+
 #include <stdio.h>
 #include <string.h>
 
@@ -23,6 +25,8 @@
 #include "slurp.h"
 #include "globals.h"
 
+#include "bridge.h"
+
 
 static int
 usage( char *name )
index 7b3fdab57ae97fc181fae0452a6ee4c3cd04b1de..dcd723b79f8473bc2316847f9efdf388c35ba4a4 100644 (file)
@@ -10,6 +10,7 @@
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
 #include <stdio.h>
 #include <sys/types.h>
 #ifdef SVR4
@@ -19,7 +20,7 @@
 #include <sys/file.h>
 #include <sys/ioctl.h>
 #include <signal.h>
-#include "portable.h"
+#include "bridge.h"
 
 #ifdef USE_SYSCONF
 #include <unistd.h>
index 5966c0a03bc3181d95c3bca1ef570bc0092036b6..8223e14adff930a2c8a19b0bf892bb258ff94c48 100644 (file)
@@ -14,6 +14,7 @@
  * fm.c - file management routines.
  */
 
+#include "portable.h"
 #include <stdio.h>
 #include <string.h>
 #include <signal.h>
@@ -21,6 +22,8 @@
 #include "slurp.h"
 #include "globals.h"
 
+#include "bridge.h"
+
 extern void do_admin();
 
 static void set_shutdown();
@@ -77,12 +80,20 @@ fm(
 
     /* Set up our signal handlers:
      * SIG{TERM,INT,HUP} causes a shutdown
-     * SIGUSR1 - does nothing, used to wake up sleeping threads.
-     * SIGUSR2 - causes slurpd to read its administrative interface file.
+     * SIG(STKFLT|USR1) - does nothing, used to wake up sleeping threads.
+     * SIG(UNUSED|USR2) - causes slurpd to read its administrative interface file.
      *           (not yet implemented).
      */
+#ifdef SIGSTKFLT
+    (void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
+#else
     (void) SIGNAL( SIGUSR1, (void *) do_nothing );
+#endif
+#ifdef SIGUNUSED
+    (void) SIGNAL( SIGUNUSED, (void *) do_admin );
+#else
     (void) SIGNAL( SIGUSR2, (void *) do_admin );
+#endif
     (void) SIGNAL( SIGTERM, (void *) set_shutdown );
     (void) SIGNAL( SIGINT, (void *) set_shutdown );
     (void) SIGNAL( SIGHUP, (void *) set_shutdown );
@@ -160,7 +171,11 @@ set_shutdown()
     int        i;
 
     sglob->slurpd_shutdown = 1;                                /* set flag */
+#ifdef SIGSTKFLT
+    pthread_kill( sglob->fm_tid, SIGSTKFLT );  /* wake up file mgr */
+#else
     pthread_kill( sglob->fm_tid, SIGUSR1 );            /* wake up file mgr */
+#endif
     sglob->rq->rq_lock( sglob->rq );                   /* lock queue */
     pthread_cond_broadcast( &(sglob->rq->rq_more) );   /* wake repl threads */
     for ( i = 0; i < sglob->num_replicas; i++ ) {
@@ -181,7 +196,11 @@ set_shutdown()
 void
 do_nothing()
 {
+#ifdef SIGSTKFLT
+    (void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
+#else
     (void) SIGNAL( SIGUSR1, (void *) do_nothing );
+#endif
 }
 
 
index a3b935faa578f384b348171f9122abe6aa06c260..98ffb2917c236b95acf5b6102f4ed1d324b15b20 100644 (file)
@@ -121,7 +121,7 @@ main(
      * Start the main file manager thread (in fm.c).
      */
     pthread_attr_init( &attr );
-    if ( pthread_create( &(sglob->fm_tid), attr, (void *) fm, (void *) NULL )
+    if ( pthread_create( &(sglob->fm_tid), &attr, (void *) fm, (void *) NULL )
            != 0 ) {
        Debug( LDAP_DEBUG_ANY, "file manager pthread_create failed\n",
                0, 0, 0 );
index ed25a629077031feed19d6dee387adaea5b66f1b..ce878390fd3092486aa7e876204da519509a5b32 100644 (file)
@@ -59,7 +59,7 @@ start_replica_thread(
     pthread_attr_init( &attr );
     pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
 
-    if ( pthread_create( &(ri->ri_tid), attr, (void *) replicate,
+    if ( pthread_create( &(ri->ri_tid), &attr, (void *) replicate,
            (void *) ri ) != 0 ) {
        Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" pthread_create failed\n",
                ri->ri_hostname, ri->ri_port, 0 );
index cc478d1e6a77386007feb94078d5b432e56bfd87..b1df234a68082ca5b3b9182320f0641390519abd 100644 (file)
@@ -16,7 +16,7 @@
  * instance.  The Ri struct is defined in slurp.h
  */
 
-
+#include "portable.h"
 
 #include <stdio.h>
 #include <signal.h>
@@ -24,6 +24,7 @@
 #include "slurp.h"
 #include "globals.h"
 
+#include "bridge.h"
 
 /* External references */
 #ifdef NEEDPROTOS
@@ -60,7 +61,11 @@ Ri_process(
     int                rc ;
     char       *errmsg;
 
+#ifdef SIGSTKFLT
+    (void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
+#else
     (void) SIGNAL( SIGUSR1, (void *) do_nothing );
+#endif
     (void) SIGNAL( SIGPIPE, SIG_IGN );
     if ( ri == NULL ) {
        Debug( LDAP_DEBUG_ANY, "Error: Ri_process: ri == NULL!\n", 0, 0, 0 );
@@ -146,7 +151,8 @@ Ri_process(
 
 
 /*
- * Wake a replication thread which may be sleeping.  Send it a SIGUSR1.
+ * Wake a replication thread which may be sleeping.
+ * Send it a SIG(STKFLT|USR1).
  */
 static void
 Ri_wake(
@@ -156,8 +162,13 @@ Ri_wake(
     if ( ri == NULL ) {
        return;
     }
+#ifdef SIGSTKFLT
+    pthread_kill( ri->ri_tid, SIGSTKFLT );
+    (void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
+#else
     pthread_kill( ri->ri_tid, SIGUSR1 );
     (void) SIGNAL( SIGUSR1, (void *) do_nothing );
+#endif
 }