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

Diff of /lbbs/src/init.c

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

Revision 1.22 by sysadm, Wed Jun 4 13:27:09 2025 UTC Revision 1.30 by sysadm, Fri Oct 10 01:55:06 2025 UTC
# Line 14  Line 14 
14   *                                                                         *   *                                                                         *
15   ***************************************************************************/   ***************************************************************************/
16    
 #include "init.h"  
 #include "database.h"  
17  #include "bbs.h"  #include "bbs.h"
18  #include "common.h"  #include "common.h"
19  #include "log.h"  #include "database.h"
20    #include "init.h"
21  #include "io.h"  #include "io.h"
22  #include <string.h>  #include "log.h"
 #include <stdlib.h>  
23  #include <signal.h>  #include <signal.h>
24    #include <stdlib.h>
25    #include <string.h>
26    #include <unistd.h>
27  #include <sys/param.h>  #include <sys/param.h>
 #include <sys/types.h>  
28  #include <sys/stat.h>  #include <sys/stat.h>
29  #include <unistd.h>  #include <sys/types.h>
30    
31  #define CONF_DELIM_WITH_SPACE " \t\r\n"  #define CONF_DELIM_WITH_SPACE " \t\r\n"
32    
# Line 71  int load_conf(const char *conf_file) Line 71  int load_conf(const char *conf_file)
71          char *saveptr = NULL;          char *saveptr = NULL;
72          char *p, *q, *r;          char *p, *q, *r;
73          char *y, *m, *d;          char *y, *m, *d;
74            int v;
75          FILE *fin;          FILE *fin;
76    
77          // Load configuration          // Load configuration
# Line 130  int load_conf(const char *conf_file) Line 131  int load_conf(const char *conf_file)
131                  }                  }
132                  else if (strcasecmp(p, "bbs_port") == 0)                  else if (strcasecmp(p, "bbs_port") == 0)
133                  {                  {
134                          BBS_port = (in_port_t)atoi(q);                          BBS_port[0] = (in_port_t)atoi(q);
135                  }                  }
136                  else if (strcasecmp(p, "bbs_ssh") == 0)                  else if (strcasecmp(p, "bbs_ssh_port") == 0)
137                  {                  {
138                          BBS_ssh_v2 = (strcasecmp(q, "v2") == 0 ? 1 : 0);                          BBS_port[1] = (in_port_t)atoi(q);
139                  }                  }
140                  else if (strcasecmp(p, "bbs_max_client") == 0)                  else if (strcasecmp(p, "bbs_max_client") == 0)
141                  {                  {
# Line 174  int load_conf(const char *conf_file) Line 175  int load_conf(const char *conf_file)
175                                  log_error("Ignore config bbs_start_dt with incorrect value\n");                                  log_error("Ignore config bbs_start_dt with incorrect value\n");
176                                  continue;                                  continue;
177                          }                          }
178                          snprintf(BBS_start_dt, sizeof(BBS_start_dt), "%4sÄê%2sÔÂ%2sÈÕ", y, m, d);                          snprintf(BBS_start_dt, sizeof(BBS_start_dt), "%4så¹´%2s月%2sæ—¥", y, m, d);
179                    }
180                    else if (strcasecmp(p, "bbs_sys_id") == 0)
181                    {
182                            v = atoi(q);
183                            if (v <= 0 || v > BBS_MAX_USER_LIMIT)
184                            {
185                                    log_error("Ignore config bbs_sys_id with incorrect value %d\n", v);
186                                    continue;
187                            }
188                            BBS_sys_id = v;
189                  }                  }
190                  else if (strcasecmp(p, "db_host") == 0)                  else if (strcasecmp(p, "db_host") == 0)
191                  {                  {


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

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