/[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.18 by sysadm, Tue May 6 05:31:26 2025 UTC Revision 1.21 by sysadm, Sun Jun 1 03:07:42 2025 UTC
# Line 28  Line 28 
28  #include <sys/stat.h>  #include <sys/stat.h>
29  #include <unistd.h>  #include <unistd.h>
30    
31  void init_daemon(void)  int init_daemon(void)
32  {  {
33          int pid;          int pid;
34    
# Line 36  void init_daemon(void) Line 36  void init_daemon(void)
36    
37          if (pid > 0) // Parent process          if (pid > 0) // Parent process
38          {          {
39                  exit(0);                  _exit(0);
40          }          }
41          else if (pid < 0) // Error          else if (pid < 0) // error
42          {          {
43                  exit(1);                  _exit(pid);
44          }          }
45    
46          // Child process          // Child process
# Line 50  void init_daemon(void) Line 50  void init_daemon(void)
50    
51          if (pid > 0) // Parent process          if (pid > 0) // Parent process
52          {          {
53                  exit(0);                  _exit(0);
54          }          }
55          else if (pid < 0) // Error          else if (pid < 0) // error
56          {          {
57                  exit(1);                  _exit(pid);
58          }          }
59    
60          // Child process          // Child process
61          umask(022);          umask(022);
62    
63          return;          return 0;
64  }  }
65    
66  int load_conf(const char *conf_file)  int load_conf(const char *conf_file)
# Line 108  int load_conf(const char *conf_file) Line 108  int load_conf(const char *conf_file)
108                  if (strcmp(c_name, "bbs_max_client") == 0)                  if (strcmp(c_name, "bbs_max_client") == 0)
109                  {                  {
110                          fscanf(fin, "%d", &BBS_max_client);                          fscanf(fin, "%d", &BBS_max_client);
111                            if (BBS_max_client > MAX_CLIENTS_LIMIT)
112                            {
113                                    log_error("Config BBS_max_client > limit (%d), reset it to limit\n", BBS_max_client);
114                                    BBS_max_client = MAX_CLIENTS_LIMIT;
115                            }
116                    }
117                    if (strcmp(c_name, "bbs_max_client_per_ip") == 0)
118                    {
119                            fscanf(fin, "%d", &BBS_max_client_per_ip);
120                  }                  }
121                  if (strcmp(c_name, "bbs_max_user") == 0)                  if (strcmp(c_name, "bbs_max_user") == 0)
122                  {                  {


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

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