/[LeafOK_CVS]/innwebd/innbbsd.cpp
ViewVC logotype

Diff of /innwebd/innbbsd.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 by sysadm, Fri Jul 2 11:30:28 2004 UTC Revision 1.2 by sysadm, Sat Jul 3 05:52:38 2004 UTC
# Line 45  int _tmain(int argc, TCHAR* argv[], TCHA Line 45  int _tmain(int argc, TCHAR* argv[], TCHA
45                  return 1;                  return 1;
46          }          }
47    
         // TODO: 在此处为应用程序的行为编写代码。  
   
48          // System settings          // System settings
49          const char* logfile_file = _T("innbbsd.log");          const char* conf_file = _T("innbbsd.conf");
50            const char* log_file = _T("innbbsd.log");
51    
52            // Get application path
53            CString app_path;
54            int pos;
55    
56            app_path = argv[0];
57            pos = app_path.ReverseFind('\\');
58            if (pos != -1)
59                    app_path = app_path.Left(pos + 1);
60            else
61                    app_path = "";
62    
63          syslog.open(logfile_file,ios_base::out | ios_base::app);          syslog.open(app_path + log_file, ios_base::out | ios_base::app);
64    
65            // Initialize sockets
66          if(!AfxSocketInit())          if(!AfxSocketInit())
67          {          {
68                  syslog << logfile::log_head << "Sockets init failed" << endl;                  syslog << logfile::log_head << "Sockets init failed" << endl;
# Line 61  int _tmain(int argc, TCHAR* argv[], TCHA Line 72  int _tmain(int argc, TCHAR* argv[], TCHA
72      // Create the service object      // Create the service object
73      service innbbsd_srv;      service innbbsd_srv;
74    
75          CString conf_file;          innbbsd_srv.ctrld.load_conf(app_path + conf_file);
         conf_file = argv[0];  
         conf_file = conf_file.Left(conf_file.ReverseFind('\\')) + "\\innbbsd.conf";  
   
         innbbsd_srv.ctrld.load_conf(conf_file);  
76    
77          //Standalone mode          //Standalone mode
78          if (argc == 2 && _stricmp(argv[1], "-s") == 0)          if (argc == 2 && _stricmp(argv[1], "-s") == 0)


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1