--- lbbs/src/main.c 2025/05/04 14:54:55 1.21 +++ lbbs/src/main.c 2025/05/07 05:35:01 1.24 @@ -1,16 +1,15 @@ /*************************************************************************** main.c - description ------------------- - begin : Mon Oct 11 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. * * * ***************************************************************************/ @@ -119,6 +118,8 @@ int main(int argc, char *argv[]) // Change current dir strncpy(file_path_temp, argv[0], sizeof(file_path_temp) - 1); + file_path_temp[sizeof(file_path_temp) - 1] = '\0'; + chdir(dirname(file_path_temp)); chdir(".."); @@ -156,11 +157,14 @@ int main(int argc, char *argv[]) // Wait for child process exit while (SYS_child_process_count > 0) { + log_std("Waiting for %d child process to exit\n", SYS_child_process_count); sleep(1); } // Cleanup unload_menu(&bbs_menu); + log_std("Main process exit\n"); + return 0; }