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

Annotation of /lbbs/src/main.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations)
Mon Oct 18 11:34:15 2004 UTC (21 years, 5 months ago) by sysadm
Branch: MAIN
Changes since 1.2: +24 -3 lines
Content type: text/x-csrc
Fix bug

1 sysadm 1.1 /***************************************************************************
2 sysadm 1.3 main.c - description
3 sysadm 1.1 -------------------
4     begin : Mon Oct 11 2004
5     copyright : (C) 2004 by Leaflet
6     email : leaflet@leafok.com
7     ***************************************************************************/
8    
9     /***************************************************************************
10     * *
11     * This program is free software; you can redistribute it and/or modify *
12     * it under the terms of the GNU General Public License as published by *
13     * the Free Software Foundation; either version 2 of the License, or *
14     * (at your option) any later version. *
15     * *
16     ***************************************************************************/
17    
18     #include "common.h"
19    
20 sysadm 1.3 char app_home_dir[256];
21    
22 sysadm 1.1 int
23     main (int argc, char *argv[])
24     {
25 sysadm 1.3 char log_dir[256], file_log_std[256], file_log_error[256];
26    
27     //Initialize daemon
28     init_daemon ();
29    
30     //Initialize log
31     strncpy(app_home_dir,argv[0],rindex(argv[0],'/')-argv[0]+1);
32     strcpy(log_dir,app_home_dir);
33     strcat(log_dir,"log/");
34     strcpy(file_log_std,log_dir);
35     strcpy(file_log_error,log_dir);
36     strcat(file_log_std,"bbsd.log");
37     strcat(file_log_error,"error.log");
38     mkdir(log_dir,0700);
39     log_begin(file_log_std,file_log_error);
40    
41     //Initialize socket server
42     net_server("",2323);
43    
44     /*
45 sysadm 1.2 FILE *fp;
46     time_t t;
47 sysadm 1.1
48     while (1)
49 sysadm 1.2 {
50     sleep (60);
51     if ((fp = fopen ("bbsd.log", "a")) >= 0)
52 sysadm 1.1 {
53     t = time (0);
54     fprintf (fp, "I'm here at %s\n", asctime (localtime (&t)));
55     fclose (fp);
56     }
57 sysadm 1.2 }
58 sysadm 1.3 */
59 sysadm 1.1
60     return 0;
61     }

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