--- lbbs/src/fork.c 2025/05/03 13:41:21 1.14 +++ lbbs/src/fork.c 2025/05/13 07:30:10 1.17 @@ -1,16 +1,15 @@ /*************************************************************************** fork.c - description ------------------- - begin : Mon Oct 18 2004 - copyright : (C) 2004 by Leaflet - email : leaflet@leafok.com + Copyright : (C) 2004-2025 by Leaflet + Email : leaflet@leafok.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * + * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ @@ -24,6 +23,7 @@ #include #include #include +#include int fork_server() { @@ -39,6 +39,7 @@ int fork_server() } else if (pid < 0) // Error { + log_error("fork() error (%d)\n", errno); return -1; } @@ -67,6 +68,9 @@ int fork_server() bbs_main(); + // Child process exit + SYS_server_exit = 1; + if (close(socket_client) == -1) { log_error("Close client socket failed\n"); @@ -80,8 +84,5 @@ int fork_server() log_end(); - // Exit child process normally - exit(0); - return 0; }