/[LeafOK_CVS]/lbbs/src/main.c
ViewVC logotype

Diff of /lbbs/src/main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.60 by sysadm, Thu Jun 26 12:17:02 2025 UTC Revision 1.62 by sysadm, Mon Oct 13 07:13:39 2025 UTC
# Line 128  int main(int argc, char *argv[]) Line 128  int main(int argc, char *argv[])
128          strncpy(file_path_temp, argv[0], sizeof(file_path_temp) - 1);          strncpy(file_path_temp, argv[0], sizeof(file_path_temp) - 1);
129          file_path_temp[sizeof(file_path_temp) - 1] = '\0';          file_path_temp[sizeof(file_path_temp) - 1] = '\0';
130    
131          chdir(dirname(file_path_temp));          if (chdir(dirname(file_path_temp)) < 0)
132          chdir("..");          {
133                    fprintf(stderr, "chdir(%s) error: %d\n", dirname(file_path_temp), errno);
134                    return -1;
135            }
136            if (chdir("..") < 0)
137            {
138                    fprintf(stderr, "chdir(..) error: %d\n", errno);
139                    return -1;
140            }
141    
142          // Initialize log          // Initialize log
143          if (log_begin(LOG_FILE_INFO, LOG_FILE_ERROR) < 0)          if (log_begin(LOG_FILE_INFO, LOG_FILE_ERROR) < 0)
# Line 207  int main(int argc, char *argv[]) Line 215  int main(int argc, char *argv[])
215          // Load menus          // Load menus
216          if (load_menu(&bbs_menu, CONF_MENU) < 0)          if (load_menu(&bbs_menu, CONF_MENU) < 0)
217          {          {
218                    log_error("load_menu(%s) error\n", CONF_MENU);
219                    goto cleanup;
220            }
221            if (load_menu(&top10_menu, CONF_TOP10_MENU) < 0)
222            {
223                    log_error("load_menu(%s) error\n", CONF_TOP10_MENU);
224                  goto cleanup;                  goto cleanup;
225          }          }
226            top10_menu.allow_exit = 1;
227    
228          // Load data files          // Load data files
229          if (file_loader_init() < 0)          if (file_loader_init() < 0)
# Line 284  cleanup: Line 299  cleanup:
299    
300          // Cleanup menu          // Cleanup menu
301          unload_menu(&bbs_menu);          unload_menu(&bbs_menu);
302            unload_menu(&top10_menu);
303    
304          // Cleanup data pools          // Cleanup data pools
305          section_list_cleanup();          section_list_cleanup();


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1