--- innwebd/innbbsd.cpp 2004/07/03 05:52:38 1.2 +++ innwebd/innbbsd.cpp 2004/07/04 06:45:23 1.4 @@ -1,10 +1,10 @@ /*******************************************************/ /* */ -/* LeafOK Innd */ +/* LeafOK Innbbsd */ /* Copyright (C) LeafOK.com, 2003-2004 */ /* */ /* Programmed by Leaf */ -/* E-mail:leaf@leafok.com QQ:6049044 */ +/* E-mail:leaflet@leafok.com QQ:6049044 */ /* */ /* http://bbs.leafok.com */ /* http://bbs.leafok.net */ @@ -20,6 +20,7 @@ #include ".\innbbsd.h" #include ".\service.h" #include ".\bbs_fun.h" +#include ".\App_common.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -77,23 +78,50 @@ int _tmain(int argc, TCHAR* argv[], TCHA //Standalone mode if (argc == 2 && _stricmp(argv[1], "-s") == 0) { - innbbsd_srv.ctrld.begin(); - innbbsd_srv.ctrld.StartupChild(); + innbbsd_srv.ctrld.InitThreadPool(); - while (innbbsd_srv.ctrld.IsRunning()) + if (innbbsd_srv.ctrld.begin() == 0) { - Sleep(100); - } + syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl; - innbbsd_srv.ctrld.bbsd.end(); - innbbsd_srv.ctrld.innd.end(); - innbbsd_srv.ctrld.outd.end(); - innbbsd_srv.ctrld.end(); + innbbsd_srv.ctrld.StartupChild(); + + while (innbbsd_srv.ctrld.IsRunning()) + { + Sleep(100); + } + + innbbsd_srv.ctrld.ShutdownChild(); + } + else + { + syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl; + } + + if (innbbsd_srv.ctrld.end() == 0) + { + syslog << logfile::log_head << "End CONTROLD ... OK" << endl; + } + else + { + syslog << logfile::log_head << "End CONTROLD ... Failed" << endl; + } + + innbbsd_srv.ctrld.CleanupThreadPool(); + + ExitProcess(0); return 0; } - // Parse for standard arguments (install, uninstall, version etc.) + // Display version infomation + if (argc == 2 && _stricmp(argv[1], "-c") == 0) + { + cout << App_common::GetVersion() << endl; + cout << App_common::Copyright << endl; + } + + // Parse for standard arguments (install, uninstall, version etc.) if (!innbbsd_srv.ParseStandardArgs(argc, argv)) { //DebugBreak(); innbbsd_srv.StartService();