Branch: Tag:

2001-11-14

2001-11-14 16:29:50 by Tomas Nilsson <tomas@roxen.com>

Added support for creating and using a mysql_pid file.

Rev: server/base_server/roxenloader.pike:1.304
Rev: server/tools/ntroxen/startdll/cmdline.cpp:1.16
Rev: server/tools/ntroxen/startdll/cmdline.h:1.10
Rev: server/tools/ntroxen/startdll/enumproc.c:1.2
Rev: server/tools/ntroxen/startdll/enumproc.h:1.2
Rev: server/tools/ntroxen/startdll/roxen.cpp:1.10
Rev: server/tools/ntroxen/startdll/startdll.cpp:1.10
Rev: server/tools/ntroxen/version.h:1.14

1:   // cmdline.cpp: implementation of the CCmdLine class.   // - // $Id: cmdline.cpp,v 1.15 2001/11/13 10:45:49 tomas Exp $ + // $Id: cmdline.cpp,v 1.16 2001/11/14 16:29:49 tomas Exp $   //   //////////////////////////////////////////////////////////////////////   
209:   //////////////////////////////////////////////////////////////////////      CCmdLine::CCmdLine() - : m_SelfTestDir("etc\\test"), m_LogDir("..\\logs") + : m_SelfTestDir("etc\\test"), m_LogDir("..\\logs"), +  m_ConfigDir("..\\configurations")   {    m_bPreloaded = FALSE;   
799:   // Parse current argument (always argv[0]) and   // return the number of parameters used   // - int CCmdLine::ParseArg(char *argv[], CCmdLine::tArgType & type) + int CCmdLine::ParseArg(int argc, char *argv[], CCmdLine::tArgType & type)   {    char *value;   
1127:    // passhelp=1    if (Match(*argv, "--program", NULL, NULL) )    { +  if (argc > 1) +  {    m_saRoxenArgs.Add(*argv);    m_saRoxenArgs.Add(argv[1]);    m_bOnce = TRUE;
1136:    type = eArgNtLoader;    return 2;    } +  else +  { +  type = eArgMoreData; +  return 1; +  } +  }       //'--cd')    // cd_to="$2"
1145:    // shift    if (Match(*argv, "--cd", NULL, NULL) )    { +  if (argc > 1) +  {    m_saRoxenArgs.Add(*argv);    m_saRoxenArgs.Add(argv[1]);    m_bOnce = TRUE;    type = eArgNtLoader;    return 2;    } -  +  else +  { +  type = eArgMoreData; +  return 1; +  } +  }       //--debug-without=*|-r*|-d*|-t*|-l*|-w*|-a*|-p*|--*-debug*)    // # Argument passed along to Pike.
1338:       // Walk through the argument list    i = 1; // skip argv[0] -  while (i < argc) +  while (i < argc && ret)    { -  int numParsed = ParseArg(&argv[i], type); +  int numParsed = ParseArg(argc-i, &argv[i], type);       switch (type)    {
1381:       case eArgSelfTest:    { -  // Make sure that mysql is not running -  KillMySql(); -  +     // Make sure the var directory exists    CreateDirectory("..\\var", NULL);   
1409:       m_bOnce = TRUE;    m_iDebug = max(m_iDebug, 1); -  m_saRoxenArgs.Add("--config-dir=../var/test_config"); +  m_ConfigDir = "../var/test_config"; +  m_saRoxenArgs.Add(("--config-dir=" + m_ConfigDir).c_str());    m_saRoxenArgs.Add("--remove-dumped");    -  +  // Make sure that mysql is not running +  KillMySql(m_ConfigDir.c_str()); +     SetEnvironmentVariable("COPYCMD", "/Y");    system("rmdir /Q /S ..\\var\\test_config >NUL:");   
1433:    break;       +  case eArgMoreData: +  ret = FALSE; +  OutputLineFmt(hOut, ".BArgument requires more data: %sB.", argv[i]); +  break; +  +     case eArgUnsupported:    OutputLineFmt(hOut, ".BArgument not supported: %sB.", argv[i]);    break;