--- lbbs/src/init.c 2025/05/06 05:31:26 1.18 +++ lbbs/src/init.c 2025/05/13 07:30:10 1.19 @@ -28,19 +28,15 @@ #include #include -void init_daemon(void) +int init_daemon(void) { int pid; pid = fork(); - if (pid > 0) // Parent process + if (pid != 0) // Parent or error { - exit(0); - } - else if (pid < 0) // Error - { - exit(1); + return pid; } // Child process @@ -48,19 +44,15 @@ void init_daemon(void) pid = fork(); - if (pid > 0) // Parent process - { - exit(0); - } - else if (pid < 0) // Error + if (pid != 0) // Parent or error { - exit(1); + return pid; } // Child process umask(022); - return; + return 0; } int load_conf(const char *conf_file)