/[LeafOK_CVS]/lbbs/src/main.c
ViewVC logotype

Diff of /lbbs/src/main.c

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

Revision 1.2 by sysadm, Mon Oct 18 08:44:54 2004 UTC Revision 1.4 by sysadm, Tue Oct 19 17:11:39 2004 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2                            bbsd.c  -  description                            main.c  -  description
3                               -------------------                               -------------------
4      begin                : Mon Oct 11 2004      begin                : Mon Oct 11 2004
5      copyright            : (C) 2004 by Leaflet      copyright            : (C) 2004 by Leaflet
# Line 15  Line 15 
15   *                                                                         *   *                                                                         *
16   ***************************************************************************/   ***************************************************************************/
17    
18    #include "bbs.h"
19  #include "common.h"  #include "common.h"
20    
21  int  int
22  main (int argc, char *argv[])  main (int argc, char *argv[])
23  {  {
24      char log_dir[256], file_log_std[256], file_log_error[256], file_config[256];
25      
26      //Initialize daemon
27      init_daemon ();
28    
29      //Initialize log
30      strncpy(app_home_dir, argv[0], rindex(argv[0],'/')-argv[0]+1);
31      strcpy(log_dir, app_home_dir);
32      strcat(log_dir, "log/");
33      strcpy(file_log_std, log_dir);
34      strcpy(file_log_error, log_dir);
35      strcat(file_log_std, "bbsd.log");
36      strcat(file_log_error, "error.log");
37      mkdir(log_dir,0700);
38      if (log_begin(file_log_std,file_log_error)<0)
39        exit(-1);
40    
41      //Load configuration
42      strcpy(file_config, app_home_dir);
43      strcat(file_config, "conf/bbsd.conf");
44      if (load_conf(file_config)<0)
45        exit(-2);
46    
47      //Initialize socket server
48      net_server(BBS_address, BBS_port);
49    
50    /*
51    FILE *fp;    FILE *fp;
52    time_t t;    time_t t;
53    
   init_daemon ();  
   
54    while (1)    while (1)
55      {      {
56        sleep (60);        sleep (60);
# Line 35  main (int argc, char *argv[]) Line 61  main (int argc, char *argv[])
61            fclose (fp);            fclose (fp);
62          }          }
63      }      }
64    */
65    
66    return 0;    return 0;
67  }  }


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

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