--- lbbs/src/init.c 2025/05/05 14:27:57 1.17 +++ lbbs/src/init.c 2025/05/13 11:32:01 1.20 @@ -1,16 +1,15 @@ /*************************************************************************** init.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. * * * ***************************************************************************/ @@ -29,7 +28,7 @@ #include #include -void init_daemon(void) +int init_daemon(void) { int pid; @@ -37,11 +36,11 @@ void init_daemon(void) if (pid > 0) // Parent process { - exit(0); + _exit(0); } - else if (pid < 0) // Error + else if (pid < 0) // error { - exit(1); + _exit(pid); } // Child process @@ -51,17 +50,17 @@ void init_daemon(void) if (pid > 0) // Parent process { - exit(0); + _exit(0); } - else if (pid < 0) // Error + else if (pid < 0) // error { - exit(1); + _exit(pid); } // Child process umask(022); - return; + return 0; } int load_conf(const char *conf_file)