]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/tools/ldif2index.c
Import minor trace output cleanup
[openldap] / servers / slapd / tools / ldif2index.c
index 1287f502d08f40eddce01fb70debe7a453c0a99a..2b39bca046375342a7c3c2784e61f299cca56260 100644 (file)
@@ -1,7 +1,9 @@
 #include "portable.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 
+#include <ac/ctype.h>
 #include <ac/string.h>
 #include <ac/socket.h>
 #include <ac/unistd.h>
 
 #define MAXARGS                100
 
-int            ldap_debug;
-int            ldap_syslog;
-int            ldap_syslog_level;
-int            global_schemacheck;
-long           num_entries_sent;
-long           num_bytes_sent;
-int            active_threads;
-char           *default_referral;
-struct objclass        *global_oc;
-time_t         currenttime;
-pthread_t      listener_tid;
-pthread_mutex_t        num_sent_mutex;
-pthread_mutex_t        entry2str_mutex;
-pthread_mutex_t        active_threads_mutex;
-pthread_mutex_t        new_conn_mutex;
-pthread_mutex_t        currenttime_mutex;
-pthread_mutex_t        replog_mutex;
-pthread_mutex_t        ops_mutex;
-pthread_mutex_t        regex_mutex;
-
-
 static void
 usage( char *name )
 {
@@ -56,6 +37,7 @@ main( int argc, char **argv )
        int             dbnum;
        unsigned long   id;
        Backend         *be = NULL;
+       struct ldbminfo *li;
        struct berval   bv;
        struct berval   *vals[2];
 
@@ -119,6 +101,10 @@ main( int argc, char **argv )
        }
        be = &backends[dbnum];
 
+       /* disable write sync'ing */
+       li = (struct ldbminfo *) be->be_private;
+       li->li_dbcachewsync = 0;
+
        attr_masks( be->be_private, attr, &indexmask, &syntaxmask );
        if ( indexmask == 0 ) {
                exit( 0 );
@@ -151,7 +137,11 @@ main( int argc, char **argv )
                }
                if ( line[0] == '\n' || stop && buf && *buf ) {
                        if ( *buf != '\n' ) {
-                               id++;
+                               if (isdigit(*buf)) {
+                                       id = atol(buf);
+                               } else {
+                                       id++;
+                               }
                                s = buf;
                                elineno = 0;
                                while ( (linep = str_getline( &s )) != NULL ) {