From 1a7acaa945cd71b4cf72b1af557ae24293ff389e Mon Sep 17 00:00:00 2001 From: Gary Williams Date: Wed, 14 Apr 1999 14:11:56 +0000 Subject: [PATCH] fix arg loop, move starttime to mimic.c --- servers/slapd/tools/ldif2ldbm.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/servers/slapd/tools/ldif2ldbm.c b/servers/slapd/tools/ldif2ldbm.c index d958721b7f..ff23513482 100644 --- a/servers/slapd/tools/ldif2ldbm.c +++ b/servers/slapd/tools/ldif2ldbm.c @@ -17,9 +17,16 @@ #include "../back-ldbm/back-ldbm.h" #include "ldif.h" + +#ifdef WIN32 +#define INDEXCMD "ldif2index.exe" +#define ID2ENTRYCMD "ldif2id2entry.exe" +#define ID2CHILDRENCMD "ldif2id2children.exe" +#else #define INDEXCMD "ldif2index" #define ID2ENTRYCMD "ldif2id2entry" #define ID2CHILDRENCMD "ldif2id2children" +#endif #define MAXARGS 100 static void fork_child( char *prog, char *args[] ); @@ -30,10 +37,6 @@ static char *inputfile; static int maxkids = 1; static int nkids; -#ifdef WIN32 -time_t starttime; -#endif - static void usage( char *name ) { @@ -290,20 +293,23 @@ fork_child( char *prog, char *args[] ) { PROCESS_INFORMATION proc_info; PROCESS_INFORMATION *pinfo = &proc_info; + STARTUPINFO start_info; - int i = 0; + int i = 1; char cmdLine[2048]; + memset( &start_info, 0, sizeof(STARTUPINFO) ); memset( cmdLine, 0, sizeof(cmdLine) ); strcpy( cmdLine, prog ); - while ( args[i] != NULL ); + while ( args[i] != NULL ) { strcat( cmdLine, " " ); strcat( cmdLine, args[i] ); + i++; } if ( !CreateProcess( NULL, cmdLine, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, - NULL, NULL, NULL, pinfo ) ) + NULL, NULL, &start_info, pinfo ) ) { fprintf( stderr, "Could not create %s: ", prog ); perror( "CreateProcess" ); -- 2.39.5