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

Diff of /lbbs/src/fork.c

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

Revision 1.16 by sysadm, Mon May 12 03:54:14 2025 UTC Revision 1.20 by sysadm, Thu May 15 06:24:11 2025 UTC
# Line 19  Line 19 
19  #include "log.h"  #include "log.h"
20  #include "io.h"  #include "io.h"
21  #include "fork.h"  #include "fork.h"
22    #include "menu.h"
23  #include <stdio.h>  #include <stdio.h>
24  #include <string.h>  #include <string.h>
25    #include <signal.h>
26  #include <unistd.h>  #include <unistd.h>
27  #include <stdlib.h>  #include <stdlib.h>
28  #include <errno.h>  #include <errno.h>
# Line 66  int fork_server() Line 68  int fork_server()
68                  return -4;                  return -4;
69          }          }
70    
71            SYS_child_process_count = 0;
72    
73            // Reset signal handler to default
74            signal(SIGHUP, SIG_DFL);
75            signal(SIGCHLD, SIG_DFL);
76            signal(SIGTERM, SIG_DFL);
77            
78          bbs_main();          bbs_main();
79    
80            // Child process exit
81            SYS_server_exit = 1;
82    
83          if (close(socket_client) == -1)          if (close(socket_client) == -1)
84          {          {
85                  log_error("Close client socket failed\n");                  log_error("Close client socket failed\n");
# Line 78  int fork_server() Line 90  int fork_server()
90          close(STDOUT_FILENO);          close(STDOUT_FILENO);
91    
92          log_std("Process exit normally\n");          log_std("Process exit normally\n");
   
93          log_end();          log_end();
94    
95          // Exit child process normally          _exit(0);
96          exit(0);          
   
97          return 0;          return 0;
98  }  }


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

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