Skip to content
Permalink
Browse files

[11502] Fixed windows service run after adding posix daemon support

  • Loading branch information...
VladimirMangos
VladimirMangos committed May 17, 2011
1 parent fce30b4 commit 0f9fa7d0b7fb8f9ce135b148a03346c5d7f12b5c
Showing with 25 additions and 3 deletions.
  1. +11 −0 src/mangosd/Main.cpp
  2. +13 −2 src/realmd/Main.cpp
  3. +1 −1 src/shared/revision_nr.h
@@ -87,12 +87,14 @@ extern int main(int argc, char **argv)
ACE_Get_Opt cmd_opts(argc, argv, options);
cmd_opts.long_option("version", 'v');

#ifndef WIN32 // need call before options for posix daemon
if (!sConfig.SetSource(cfg_file))
{
sLog.outError("Could not find configuration file %s.", cfg_file);
Log::WaitBeforeContinueIfNeed();
return 1;
}
#endif

int option;
while ((option = cmd_opts()) != EOF)
@@ -161,6 +163,15 @@ extern int main(int argc, char **argv)
}
}

#ifdef WIN32 // need call after options for windows service
if (!sConfig.SetSource(cfg_file))
{
sLog.outError("Could not find configuration file %s.", cfg_file);
Log::WaitBeforeContinueIfNeed();
return 1;
}
#endif

sLog.outString( "%s [world-daemon]", _FULLVERSION(REVISION_DATE,REVISION_TIME,REVISION_NR,REVISION_ID) );
sLog.outString( "<Ctrl-C> to stop.\n\n" );

@@ -96,14 +96,16 @@ extern int main(int argc, char **argv)
ACE_Get_Opt cmd_opts(argc, argv, options);
cmd_opts.long_option("version", 'v');

int option;

#ifndef WIN32 // need call before options for posix daemon
if (!sConfig.SetSource(cfg_file))
{
sLog.outError("Could not find configuration file %s.", cfg_file);
Log::WaitBeforeContinueIfNeed();
return 1;
}
#endif

int option;

while ((option = cmd_opts()) != EOF)
{
@@ -171,6 +173,15 @@ extern int main(int argc, char **argv)
}
}

#ifdef WIN32 // need call after options for windows service
if (!sConfig.SetSource(cfg_file))
{
sLog.outError("Could not find configuration file %s.", cfg_file);
Log::WaitBeforeContinueIfNeed();
return 1;
}
#endif

sLog.Initialize();

sLog.outString( "%s [realm-daemon]", _FULLVERSION(REVISION_DATE,REVISION_TIME,REVISION_NR,REVISION_ID) );
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11501"
#define REVISION_NR "11502"
#endif // __REVISION_NR_H__

0 comments on commit 0f9fa7d

Please sign in to comment.
You can’t perform that action at this time.