/[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.14 by sysadm, Sat May 3 13:41:21 2025 UTC Revision 1.17 by sysadm, Tue May 13 07:30:10 2025 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2                                                    fork.c  -  description                                                    fork.c  -  description
3                                                           -------------------                                                           -------------------
4          begin                : Mon Oct 18 2004          Copyright            : (C) 2004-2025 by Leaflet
5          copyright            : (C) 2004 by Leaflet          Email                : leaflet@leafok.com
         email                : leaflet@leafok.com  
6   ***************************************************************************/   ***************************************************************************/
7    
8  /***************************************************************************  /***************************************************************************
9   *                                                                         *   *                                                                         *
10   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
11   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
12   *   the Free Software Foundation; either version 2 of the License, or     *   *   the Free Software Foundation; either version 3 of the License, or     *
13   *   (at your option) any later version.                                   *   *   (at your option) any later version.                                   *
14   *                                                                         *   *                                                                         *
15   ***************************************************************************/   ***************************************************************************/
# Line 24  Line 23 
23  #include <string.h>  #include <string.h>
24  #include <unistd.h>  #include <unistd.h>
25  #include <stdlib.h>  #include <stdlib.h>
26    #include <errno.h>
27    
28  int fork_server()  int fork_server()
29  {  {
# Line 39  int fork_server() Line 39  int fork_server()
39          }          }
40          else if (pid < 0) // Error          else if (pid < 0) // Error
41          {          {
42                    log_error("fork() error (%d)\n", errno);
43                  return -1;                  return -1;
44          }          }
45    
# Line 67  int fork_server() Line 68  int fork_server()
68    
69          bbs_main();          bbs_main();
70    
71            // Child process exit
72            SYS_server_exit = 1;
73    
74          if (close(socket_client) == -1)          if (close(socket_client) == -1)
75          {          {
76                  log_error("Close client socket failed\n");                  log_error("Close client socket failed\n");
# Line 80  int fork_server() Line 84  int fork_server()
84    
85          log_end();          log_end();
86    
         // Exit child process normally  
         exit(0);  
   
87          return 0;          return 0;
88  }  }


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

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