--- lbbs/src/init.c 2025/05/13 07:30:10 1.19 +++ lbbs/src/init.c 2025/05/13 11:32:01 1.20 @@ -34,9 +34,13 @@ int init_daemon(void) pid = fork(); - if (pid != 0) // Parent or error + if (pid > 0) // Parent process { - return pid; + _exit(0); + } + else if (pid < 0) // error + { + _exit(pid); } // Child process @@ -44,9 +48,13 @@ int init_daemon(void) pid = fork(); - if (pid != 0) // Parent or error + if (pid > 0) // Parent process + { + _exit(0); + } + else if (pid < 0) // error { - return pid; + _exit(pid); } // Child process