Changeset 2320 in MondoRescue for branches/2.2.10/mondo/src/common/newt-specific.c
- Timestamp:
- Aug 18, 2009, 2:37:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/newt-specific.c
r2319 r2320 294 294 fatal_error(char *error_string) { 295 295 /*@ buffers ***************************************************** */ 296 char fatalstr[MAX_NEWT_COMMENT_LEN] = 297 "-------FATAL ERROR---------"; 298 char *tmp; 299 char *command; 296 char *command = NULL; 300 297 static bool already_exiting = FALSE; 301 298 302 299 /*@ end vars **************************************************** */ 303 300 304 malloc_string(command);305 tmp = malloc(MAX_NEWT_COMMENT_LEN);306 301 set_signals(FALSE); // link to external func 307 302 g_exiting = TRUE; … … 311 306 log_msg(2, "mastermind %d is exiting", (int) getpid()); 312 307 kill(g_main_pid, SIGTERM); 313 paranoid_free(tmp);314 308 finish(1); 315 309 } … … 319 313 log_msg(2, "non-m/m %d is exiting", (int) getpid()); 320 314 kill(g_main_pid, SIGTERM); 321 paranoid_free(tmp);322 315 finish(1); 323 316 } … … 327 320 if (already_exiting) { 328 321 log_msg(3, "...I'm already exiting. Give me time, Julian!"); 329 paranoid_free(tmp);330 322 finish(1); 331 323 } … … 338 330 kill_anything_like_this("ntfsclone"); 339 331 sync(); 340 /*341 sprintf(tmp, "umount %s", g_tmpfs_mountpt);342 for (i = 0; i < 10 && run_program_and_log_output(tmp, 5); i++) {343 log_msg(2, "Waiting for child processes to terminate");344 sleep(1);345 run_program_and_log_output(tmp, 5);346 }347 */348 332 349 333 chdir("/"); 350 334 if (g_selfmounted_isodir) { 351 sprintf(command, "umount %s", g_selfmounted_isodir);335 mr_asprintf(&command, "umount %s", g_selfmounted_isodir); 352 336 run_program_and_log_output(command, 5); 353 sprintf(command, "rmdir %s", g_selfmounted_isodir); 337 mr_free(command); 338 mr_asprintf(&command, "rmdir %s", g_selfmounted_isodir); 354 339 run_program_and_log_output(command, 5); 340 mr_free(command); 355 341 } 356 342 357 343 if (!g_text_mode) { 358 log_msg(0, fatalstr);344 log_msg(0, "-------FATAL ERROR---------"); 359 345 log_msg(0, error_string); 360 346 newtFinished(); … … 362 348 363 349 printf("---FATALERROR--- %s\n", error_string); 364 printf 365 ("If you require technical support, please contact the mailing list.\n"); 350 printf("If you require technical support, please contact the mailing list.\n"); 366 351 printf("See http://www.mondorescue.org for details.\n"); 367 printf 368 ("The list's members can help you, if you attach that file to your e-mail.\n"); 352 printf("The list's members can help you, if you attach that file to your e-mail.\n"); 369 353 printf("Log file: %s\n", MONDO_LOGFILE); 370 354 printf("Mondo has aborted.\n"); … … 372 356 log_msg(3, "FYI - g_main_pid is blank"); 373 357 } 374 paranoid_free(tmp);375 paranoid_free(command);376 358 finish(254); 377 359 } … … 405 387 mr_asprintf(&command, "umount %s", g_selfmounted_isodir); 406 388 run_program_and_log_output(command, 1); 407 paranoid_free(command); 389 mr_free(command); 390 408 391 mr_asprintf(&command, "rmdir %s", g_selfmounted_isodir); 409 392 run_program_and_log_output(command, 1); 410 paranoid_free(command);393 mr_free(command); 411 394 } 412 395 if (!g_text_mode) { … … 443 426 mr_free(bkpinfo->exclude_paths); 444 427 mr_free(bkpinfo->include_paths); 428 mr_free(bkpinfo->scratchdir); 445 429 446 430 /* Then free the structure */ 447 paranoid_free(bkpinfo);431 mr_free(bkpinfo); 448 432 free_libmondo_global_strings(); 449 433 free_newt_stuff(); … … 947 931 } 948 932 949 err_log_lines = 950 (char **) malloc(sizeof(char *) * g_noof_log_lines); 951 if (!err_log_lines) { 952 fatal_error("Out of memory"); 953 } 933 err_log_lines = (char **) mr_malloc(sizeof(char *) * g_noof_log_lines); 954 934 955 935 for (i = 0; i < g_noof_log_lines; i++) { 956 err_log_lines[i] = (char *) malloc(MAX_NEWT_COMMENT_LEN); 957 if (!err_log_lines[i]) { 958 fatal_error("Out of memory"); 959 } 936 err_log_lines[i] = (char *) mr_malloc(MAX_NEWT_COMMENT_LEN); 960 937 } 961 938 … … 1055 1032 } 1056 1033 if (!g_text_mode) { 1057 // log_it("refreshing");1058 1034 newtRefresh(); 1059 1035 } … … 1080 1056 void 1081 1057 update_progress_form(char *blurb3) { 1082 /* log_it("update_progress_form --- called"); */1083 1058 if (g_current_progress == -999) { 1084 /* log_it("You're trying to update progress form when it ain't open. Aww, that's OK. I'll let it go. It's a bit naughty but it's a nonfatal error. No prob, Bob."); */1085 1059 return; 1086 1060 } … … 1194 1168 } 1195 1169 } 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1170 1209 1171 … … 1280 1242 } 1281 1243 newtPushHelpLine(title_sz); 1282 // newtOpenWindow (23, 3, 34, 17, minimsg_sz);1283 1244 newtCenteredWindow(34, 17, minimsg_sz); 1284 1245 b1 = newtButton(1, 1, "CD-R disks ");
Note:
See TracChangeset
for help on using the changeset viewer.