1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

fixed the service bits of the IM

This commit is contained in:
reggie@ubuntu.(none)
2005-09-13 14:53:19 -05:00
parent 6985adffc1
commit 31be8fb694
10 changed files with 58 additions and 31 deletions

View File

@@ -18,9 +18,6 @@
#pragma implementation
#endif
#ifdef __WIN__
#include <process.h>
#endif
#include "instance.h"
#include "mysql_manager_error.h"
@@ -171,25 +168,24 @@ static int start_process(Instance_options *instance_options,
ZeroMemory(pi, sizeof(PROCESS_INFORMATION));
int cmdlen= 0;
for (int i= 1; instance_options->argv[i] != 0; i++)
cmdlen+= strlen(instance_options->argv[i]) + 1;
cmdlen++; /* we have to add a single space for CreateProcess (see docs) */
for (int i= 0; instance_options->argv[i] != 0; i++)
cmdlen+= strlen(instance_options->argv[i]) + 3;
cmdlen++; /* make room for the null */
char *cmdline= NULL;
if (cmdlen > 0)
char *cmdline= new char[cmdlen];
if (cmdline == NULL)
return 1;
for (int i= 0; instance_options->argv[i] != 0; i++)
{
cmdline= new char[cmdlen];
cmdline[0]= 0;
for (int i= 1; instance_options->argv[i] != 0; i++)
{
strcat(cmdline, " ");
strcat(cmdline, instance_options->argv[i]);
}
strcat(cmdline, "\"");
strcat(cmdline, instance_options->argv[i]);
strcat(cmdline, "\" ");
}
/* Start the child process */
BOOL result=
CreateProcess(instance_options->mysqld_path, /* File to execute */
CreateProcess(NULL, /* Put it all in cmdline */
cmdline, /* Command line */
NULL, /* Process handle not inheritable */
NULL, /* Thread handle not inheritable */