]> git.sur5r.net Git - openldap/commitdiff
fix arg loop, move starttime to mimic.c
authorGary Williams <gwilliams@openldap.org>
Wed, 14 Apr 1999 14:11:56 +0000 (14:11 +0000)
committerGary Williams <gwilliams@openldap.org>
Wed, 14 Apr 1999 14:11:56 +0000 (14:11 +0000)
servers/slapd/tools/ldif2ldbm.c

index d958721b7f544868ce45c9b4ef9b05ed258df9e9..ff2351348211dfd1c436223e8b0bccfd719b9b32 100644 (file)
 #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" );