/[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.25 by sysadm, Mon Jun 16 14:30:44 2025 UTC Revision 1.31 by sysadm, Tue Oct 21 06:24:51 2025 UTC
# Line 14  Line 14 
14   *                                                                         *   *                                                                         *
15   ***************************************************************************/   ***************************************************************************/
16    
 #define _POSIX_C_SOURCE 200809L  
   
 #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 <strings.h>  
 #include <stdlib.h>  
23  #include <signal.h>  #include <signal.h>
24    #include <stdlib.h>
25    #include <string.h>
26  #include <unistd.h>  #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 <sys/types.h>
30    
31  #define CONF_DELIM_WITH_SPACE " \t\r\n"  #define CONF_DELIM_WITH_SPACE " \t\r\n"
32    
# Line 74  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 157  int load_conf(const char *conf_file) Line 155  int load_conf(const char *conf_file)
155                                  BBS_max_client_per_ip = MAX_CLIENT_PER_IP_LIMIT;                                  BBS_max_client_per_ip = MAX_CLIENT_PER_IP_LIMIT;
156                          }                          }
157                  }                  }
                 else if (strcasecmp(p, "bbs_max_user") == 0)  
                 {  
                         BBS_max_user = atoi(q);  
                         if (BBS_max_user <= 0 || BBS_max_user > BBS_MAX_USER_LIMIT)  
                         {  
                                 log_error("Ignore config bbs_max_client with incorrect value %d\n", BBS_max_user);  
                                 BBS_max_user = BBS_MAX_USER_LIMIT;  
                         }  
                 }  
158                  else if (strcasecmp(p, "bbs_start_dt") == 0)                  else if (strcasecmp(p, "bbs_start_dt") == 0)
159                  {                  {
160                          y = strtok_r(q, "-", &saveptr);                          y = strtok_r(q, "-", &saveptr);
# Line 177  int load_conf(const char *conf_file) Line 166  int load_conf(const char *conf_file)
166                                  log_error("Ignore config bbs_start_dt with incorrect value\n");                                  log_error("Ignore config bbs_start_dt with incorrect value\n");
167                                  continue;                                  continue;
168                          }                          }
169                          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);
170                    }
171                    else if (strcasecmp(p, "bbs_sys_id") == 0)
172                    {
173                            v = atoi(q);
174                            if (v <= 0)
175                            {
176                                    log_error("Ignore config bbs_sys_id with incorrect value %d\n", v);
177                                    continue;
178                            }
179                            BBS_sys_id = v;
180                  }                  }
181                  else if (strcasecmp(p, "db_host") == 0)                  else if (strcasecmp(p, "db_host") == 0)
182                  {                  {


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

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