Changeset 2324 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-mountlist.c
- Timestamp:
- Aug 18, 2009, 3:13:54 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-mountlist.c
r2323 r2324 341 341 if (amount_allocated > physical_drive_size) // Used to be +1, but what if you're 1 MB too high? 342 342 { 343 mr_asprintf(tmp, " %ld MB over-allocated on %s.", 344 amount_allocated - physical_drive_size, drive); 343 mr_asprintf(tmp, " %ld MB over-allocated on %s.", amount_allocated - physical_drive_size, drive); 345 344 log_it(tmp); 346 345 mr_strcat(flaws_str, "%s", tmp); … … 348 347 res++; 349 348 } else if (amount_allocated < physical_drive_size - 1) { /* NOT AN ERROR, JUST A WARNING :-) */ 350 mr_asprintf(tmp, " %ld MB unallocated on %s.", 351 physical_drive_size - amount_allocated, drive); 349 mr_asprintf(tmp, " %ld MB unallocated on %s.", physical_drive_size - amount_allocated, drive); 352 350 log_it(tmp); 353 351 mr_strcat(flaws_str, "%s", tmp); … … 403 401 return(flaws_str); 404 402 } else { 405 mr_asprintf(tmp, "%s is %ld MB", drive, physical_drive_size); 406 log_it(tmp); 407 mr_free(tmp); 403 log_it("%s is %ld MB", drive, physical_drive_size); 408 404 } 409 405 … … 424 420 } else if (curr_part_no > 5 425 421 || (curr_part_no <= 4 && prev_part_no > 0)) { 426 mr_asprintf(tmp, " Gap on %s between %d and %d.", drive, 427 prev_part_no, curr_part_no); 422 mr_asprintf(tmp, " Gap on %s between %d and %d.", drive, prev_part_no, curr_part_no); 428 423 log_it(tmp); 429 424 mr_strcat(flaws_str, "%s", tmp); … … 496 491 /* Over-allocated the disk? Unallocated space on disk? */ 497 492 if (amount_allocated > physical_drive_size + 1) { 498 mr_asprintf(tmp, " %ld MB over-allocated on %s.", 499 amount_allocated - physical_drive_size, drive); 493 mr_asprintf(tmp, " %ld MB over-allocated on %s.", amount_allocated - physical_drive_size, drive); 500 494 log_it(tmp); 501 495 mr_strcat(flaws_str, "%s", tmp); … … 503 497 res++; 504 498 } else if (amount_allocated < physical_drive_size - 1) { /* NOT AN ERROR, JUST A WARNING :-) */ 505 mr_asprintf(tmp, " %ld MB unallocated on %s.", 506 physical_drive_size - amount_allocated, drive); 499 mr_asprintf(tmp, " %ld MB unallocated on %s.", physical_drive_size - amount_allocated, drive); 507 500 log_it(tmp); 508 501 mr_strcat(flaws_str, "%s", tmp); … … 561 554 (drivelist->el[i].device, 562 555 DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE)) { 563 mr_asprintf(tmp, " Not evaluating %s (I don't know how yet)", drivelist->el[i].device); 564 log_it(tmp); 565 paranoid_free(tmp); 556 log_it(" Not evaluating %s (I don't know how yet)", drivelist->el[i].device); 566 557 } else { 567 558 log_msg(8, "Evaluating drive #%d (%s) within mountlist", i, drivelist->el[i].device); … … 576 567 log_msg(8,"Adding: %s to %s", tmp, flaws_str); 577 568 mr_strcat(flaws_str, "%s", tmp); 578 paranoid_free(tmp);569 mr_free(tmp); 579 570 } 580 571 } 581 572 res += look_for_duplicate_mountpoints(mountlist, flaws_str); 582 573 res = spread_flaws_across_three_lines(flaws_str, flaws_str_A, flaws_str_B, flaws_str_C,res); 583 paranoid_free(flaws_str);574 mr_free(flaws_str); 584 575 return(res); 585 576 } … … 654 645 mr_strcat(flaws_str, "%s", tmp); 655 646 log_it(tmp); 656 paranoid_free(tmp);647 mr_free(tmp); 657 648 res++; 658 649 } 659 paranoid_free(curr_mountpoint);650 mr_free(curr_mountpoint); 660 651 } 661 652 return (res); … … 693 684 if (!strncmp(drive, RAID_DEVICE_STUB, strlen(RAID_DEVICE_STUB))) { 694 685 log_msg(8, "Not putting %s in list of drives: it's a virtual drive", drive); 695 paranoid_free(drive);686 mr_free(drive); 696 687 continue; 697 688 } … … 700 691 if (size == 0) { 701 692 log_msg(8, "Not putting %s in list of drives: it has zero size (maybe an LVM volume)", drive); 702 paranoid_free(drive);693 mr_free(drive); 703 694 continue; 704 695 } … … 708 699 /* memory allocation */ 709 700 truncdrive = truncate_to_drive_name(drive); 710 paranoid_free(drive);701 mr_free(drive); 711 702 712 703 log_msg(8, "drive truncated to %s", truncdrive); … … 757 748 int used_by = 0; 758 749 759 /*@ buffers ********************************************************* */760 char *tmp = NULL;761 762 750 assert(output_list != NULL); 763 751 assert(mountlist != NULL); … … 769 757 for (i = 0; i < mountlist->entries; i++) { 770 758 if (strstr(mountlist->el[i].mountpoint, "raid")) { 771 used_by = 772 which_raid_device_is_using_this_partition(raidlist, 759 used_by = which_raid_device_is_using_this_partition(raidlist, 773 760 mountlist->el[i]. 774 761 device); … … 777 764 (void *) &mountlist->el[i], 778 765 sizeof(struct mountlist_line)); 779 mr_asprintf(tmp, "%s is available; user may choose to add it to raid device", output_list->el[items - 1].device); 780 log_it(tmp); 781 paranoid_free(tmp); 766 log_it("%s is available; user may choose to add it to raid device", output_list->el[items - 1].device); 782 767 } 783 768 } … … 895 880 if (j < items) { 896 881 strcat(mountlist->el[items].device, "_dup"); 897 mr_asprintf(tmp, "Duplicate entry in mountlist - renaming to %s", mountlist->el[items].device); 898 log_it(tmp); 899 paranoid_free(tmp); 882 log_it("Duplicate entry in mountlist - renaming to %s", mountlist->el[items].device); 900 883 } 901 884 mr_asprintf(tmp, "%s", mountlist->el[items].device); … … 1065 1048 1066 1049 mountlist->el[b].size = size; 1067 paranoid_free(device);1068 paranoid_free(mountpoint);1069 paranoid_free(format);1050 mr_free(device); 1051 mr_free(mountpoint); 1052 mr_free(format); 1070 1053 } 1071 1054
Note:
See TracChangeset
for help on using the changeset viewer.