--- lbbs/src/fork.c 2025/05/13 07:30:10 1.17 +++ lbbs/src/fork.c 2025/05/15 06:24:11 1.20 @@ -19,8 +19,10 @@ #include "log.h" #include "io.h" #include "fork.h" +#include "menu.h" #include #include +#include #include #include #include @@ -66,6 +68,13 @@ int fork_server() return -4; } + SYS_child_process_count = 0; + + // Reset signal handler to default + signal(SIGHUP, SIG_DFL); + signal(SIGCHLD, SIG_DFL); + signal(SIGTERM, SIG_DFL); + bbs_main(); // Child process exit @@ -81,8 +90,9 @@ int fork_server() close(STDOUT_FILENO); log_std("Process exit normally\n"); - log_end(); + _exit(0); + return 0; }