#include <stdio.h>
#include <ac/string.h>
+#include <ac/ctype.h>
#include <ac/socket.h>
+#include <ac/unistd.h>
+#include <ac/wait.h>
#include <sys/param.h>
+#include "ldapconfig.h"
#include "../slap.h"
#include "../back-ldbm/back-ldbm.h"
-#include "ldapconfig.h"
#include "ldif.h"
#define INDEXCMD "ldif2index"
#define ID2CHILDRENCMD "ldif2id2children"
#define MAXARGS 100
-extern int nbackends;
-extern Backend *backends;
-extern int ldap_debug;
-
-int ldap_debug;
-int ldap_syslog;
-int ldap_syslog_level;
-int global_schemacheck;
-int num_entries_sent;
-int 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 fork_child( char *prog, char *args[] );
static void wait4kids( int nkidval );
static char *inputfile;
static int maxkids = 1;
static int nkids;
-
+
static void
usage( char *name )
{
exit( 1 );
}
+int
main( int argc, char **argv )
{
int i, stop, status;
char *linep, *buf, *sbindir;
- char *args[10];
+ char *args[MAXARGS];
char buf2[20], buf3[20];
char line[BUFSIZ];
char cmd[MAXPATHLEN];
int dbnum;
ID id;
Backend *be = NULL;
+ struct ldbminfo *li;
struct berval bv;
struct berval *vals[2];
Avlnode *avltypes = NULL;
- extern char *optarg;
sbindir = DEFAULT_SBINDIR;
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
}
be = &backends[dbnum];
+ /* disable write sync'ing */
+ li = (struct ldbminfo *) be->be_private;
+ li->li_dbcachewsync = 0;
+
/*
* generate the id2entry index
*/
int vlen, indexmask, syntaxmask;
Datum key, data;
+ ldbm_datum_init( key );
+ ldbm_datum_init( data );
+
if ( fgets( line, sizeof(line), stdin ) != NULL ) {
int len;