Changeset 2324 in MondoRescue for branches/2.2.10/mondo/src/mondorestore
- Timestamp:
- Aug 18, 2009, 3:13:54 PM (16 years ago)
- Location:
- branches/2.2.10/mondo/src/mondorestore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/mondorestore/mondo-prep.c
r2323 r2324 484 484 fgets(incoming, MAX_STR_LEN - 1, fin)); 485 485 if (!feof(fin)) { 486 mr_asprintf(tmp, "Investigating %s", old_mountlist->el[lino].device); 487 log_it(tmp); 488 mr_free(tmp); 486 log_it("Investigating %s", old_mountlist->el[lino].device); 489 487 490 488 for (fgets(incoming, MAX_STR_LEN - 1, fin); !feof(fin) … … 497 495 *p = '\0'; 498 496 for (p--; p > incoming && *(p - 1) > 32; p--); 499 mr_asprintf(tmp, "Extrapolating %s", p); 500 log_it(tmp); 501 mr_free(tmp); 497 log_it("Extrapolating %s", p); 502 498 503 499 for (j = 0; … … 518 514 new_mountlist->entries++; 519 515 } else { 520 mr_asprintf(tmp, "Not adding %s to mountlist: it's already there", p); 521 log_it(tmp); 522 mr_free(tmp); 516 log_it("Not adding %s to mountlist: it's already there", p); 523 517 } 524 518 } … … 585 579 for (j = 1; j < raidlist->el[i].data_disks.entries; j++) { 586 580 mr_asprintf(strtmp, "%s", devices); 587 paranoid_free(devices); 588 mr_asprintf(devices, "%s %s", strtmp, 589 raidlist->el[i].data_disks.el[j].device); 590 paranoid_free(strtmp); 581 mr_free(devices); 582 mr_asprintf(devices, "%s %s", strtmp, raidlist->el[i].data_disks.el[j].device); 583 mr_free(strtmp); 591 584 } 592 585 for (j = 0; j < raidlist->el[i].spare_disks.entries; j++) { 593 586 mr_asprintf(strtmp, "%s", devices); 594 paranoid_free(devices); 595 mr_asprintf(devices, "%s %s", strtmp, 596 raidlist->el[i].spare_disks.el[j].device); 597 paranoid_free(strtmp); 587 mr_free(devices); 588 mr_asprintf(devices, "%s %s", strtmp, raidlist->el[i].spare_disks.el[j].device); 589 mr_free(strtmp); 598 590 } 599 591 // translate RAID level … … 613 605 if (raidlist->el[i].parity != -1) { 614 606 mr_asprintf(strtmp, "%s", program); 615 paranoid_free(program);607 mr_free(program); 616 608 switch(raidlist->el[i].parity) { 617 609 case 0: … … 635 627 if (raidlist->el[i].chunk_size != -1) { 636 628 mr_asprintf(strtmp, "%s", program); 637 paranoid_free(program);629 mr_free(program); 638 630 mr_asprintf(program, "%s --chunk=%d", strtmp, raidlist->el[i].chunk_size); 639 paranoid_free(strtmp);631 mr_free(strtmp); 640 632 } 641 633 if (raidlist->el[i].spare_disks.entries > 0) { 642 634 mr_asprintf(strtmp, "%s", program); 643 paranoid_free(program);635 mr_free(program); 644 636 mr_asprintf(program, "%s --spare-devices=%d", strtmp, raidlist->el[i].spare_disks.entries); 645 paranoid_free(strtmp);637 mr_free(strtmp); 646 638 } 647 639 mr_asprintf(strtmp, "%s", program); 648 paranoid_free(program);640 mr_free(program); 649 641 mr_asprintf(program, "%s %s", strtmp, devices); 650 paranoid_free(strtmp);642 mr_free(strtmp); 651 643 res = run_program_and_log_output(program, 1); 652 // free memory 653 paranoid_free(devices); 654 paranoid_free(level); 655 paranoid_free(program); 656 // return to calling instance 644 mr_free(devices); 645 mr_free(level); 646 mr_free(program); 657 647 return res; 658 648 } … … 688 678 689 679 if (strstr(format, "raid")) { // do not form RAID disks; do it to /dev/md* instead 690 mr_asprintf(tmp, "Not formatting %s (it is a RAID disk)", device); 691 log_it(tmp); 692 mr_free(tmp); 680 log_it("Not formatting %s (it is a RAID disk)", device); 693 681 return (0); 694 682 } … … 700 688 #endif 701 689 if (strlen(format) <= 2) { 702 mr_asprintf(tmp, "%s has a really small format type ('%s') - this is probably a hexadecimal string, which would suggest the partition is an image --- I shouldn't format it", device, format); 703 log_it(tmp); 704 mr_free(tmp); 690 log_it("%s has a really small format type ('%s') - this is probably a hexadecimal string, which would suggest the partition is an image --- I shouldn't format it", device, format); 705 691 return (0); 706 692 } 707 693 if (is_this_device_mounted(device)) { 708 mr_asprintf(tmp, "%s is mounted - cannot format it ", device); 709 log_to_screen(tmp); 710 mr_free(tmp); 694 log_to_screen("%s is mounted - cannot format it ", device); 711 695 return (1); 712 696 } … … 736 720 char line[MAX_STR_LEN]; 737 721 738 mr_asprintf(tmp, "Initializing Vinum device %s (this may take a *long* time)", device); 739 log_to_screen(tmp); 740 mr_free(tmp); 722 log_to_screen("Initializing Vinum device %s (this may take a *long* time)", device); 741 723 742 724 /* format raid partition */ … … 782 764 } 783 765 #else 784 mr_asprintf(tmp, "Initializing RAID device %s", device);766 log_to_screen(tmp, "Initializing RAID device %s", device); 785 767 log_to_screen(tmp); 786 768 mr_free(tmp); … … 989 971 me = &mountlist->el[lino]; // the current mountlist entry 990 972 if (!strcmp(me->mountpoint, "image")) { 991 mr_asprintf(tmp, "Not formatting %s - it's an image", me->device); 992 log_it(tmp); 993 mr_free(tmp); 973 log_it("Not formatting %s - it's an image", me->device); 994 974 } else if (!strcmp(me->format, "raid")) { 995 mr_asprintf(tmp, "Not formatting %s - it's a raid-let", me->device); 996 log_it(tmp); 997 mr_free(tmp); 975 log_it("Not formatting %s - it's a raid-let", me->device); 998 976 continue; 999 977 } else if (!strcmp(me->format, "lvm")) { 1000 mr_asprintf(tmp, "Not formatting %s - it's an LVM", me->device); 1001 log_it(tmp); 1002 mr_free(tmp); 978 log_it("Not formatting %s - it's an LVM", me->device); 1003 979 continue; 1004 980 } else if (!strncmp(me->device, "/dev/md", 7)) { 1005 mr_asprintf(tmp, "Already formatted %s - it's a soft-RAID dev", me->device); 1006 log_it(tmp); 1007 mr_free(tmp); 981 log_it("Already formatted %s - it's a soft-RAID dev", me->device); 1008 982 continue; 1009 983 } else if (!does_file_exist(me->device) 1010 984 && strncmp(me->device, "/dev/hd", 7) 1011 985 && strncmp(me->device, "/dev/sd", 7)) { 1012 mr_asprintf(tmp, "Not formatting %s yet - doesn't exist - probably an LVM", me->device); 1013 log_it(tmp); 1014 mr_free(tmp); 986 log_it("Not formatting %s yet - doesn't exist - probably an LVM", me->device); 1015 987 continue; 1016 988 } else { … … 1048 1020 } 1049 1021 1050 mr_asprintf(tmp, "format_everything () - %s", (retval) ? "failed!" : "finished successfully"); 1051 log_it(tmp); 1052 mr_free(tmp); 1022 log_it("format_everything () - %s", (retval) ? "failed!" : "finished successfully"); 1053 1023 1054 1024 if (g_partition_table_locked_up > 0) { … … 1103 1073 int res; 1104 1074 1105 /** buffers **********************************************************/1106 char *tmp = NULL;1107 1108 1075 /** end **************************************************************/ 1109 1076 … … 1111 1078 1112 1079 if (devno_we_must_allow_for >= 5) { 1113 mr_asprintf(tmp, "Making dummy primary 1 on %s", drivename); 1114 log_it(tmp); 1115 mr_free(tmp); 1080 log_it("Making dummy primary 1 on %s", drivename); 1116 1081 1117 1082 g_maximum_progress++; … … 1127 1092 } 1128 1093 for (; current_devno < devno_we_must_allow_for; current_devno++) { 1129 mr_asprintf(tmp, "Creating dummy partition %d on %s", current_devno, drivename); 1130 log_it(tmp); 1131 mr_free(tmp); 1094 log_it("Creating dummy partition %d on %s", current_devno, drivename); 1132 1095 g_maximum_progress++; 1133 1096 res = … … 1468 1431 malloc_string(format); 1469 1432 1470 mr_asprintf(tmp, "Partitioning drive %s", drivename); 1471 log_it(tmp); 1472 mr_free(tmp); 1433 log_it("Partitioning drive %s", drivename); 1473 1434 1474 1435 #if __FreeBSD__ … … 1565 1526 file = open(drivename, O_WRONLY); 1566 1527 if (file != -1) { 1567 mr_asprintf(tmp, "Warning - unable to open %s for wiping it's partition table", drivename); 1568 log_to_screen(tmp); 1569 mr_free(tmp); 1528 log_to_screen("Warning - unable to open %s for wiping it's partition table", drivename); 1570 1529 } 1571 1530 1572 1531 for (i = 0; i < 512; i++) { 1573 1532 if (!write(file, "\0", 1)) { 1574 mr_asprintf(tmp, "Warning - unable to write to %s", drivename); 1575 log_to_screen(tmp); 1576 mr_free(tmp); 1533 log_to_screen("Warning - unable to write to %s", drivename); 1577 1534 } 1578 1535 } … … 1633 1590 1634 1591 if (pout_to_fdisk) { 1635 // mark relevant partition as bootable1592 // mark relevant partition as bootable 1636 1593 mr_asprintf(tmp, "a\n%s\n", call_program_and_get_last_line_of_output ("make-me-bootable /tmp/mountlist.txt dummy")); 1637 1594 fput_string_one_char_at_a_time(pout_to_fdisk, tmp); 1638 1595 mr_free(tmp); 1639 1596 1640 // close fdisk1597 // close fdisk 1641 1598 fput_string_one_char_at_a_time(pout_to_fdisk, "w\n"); 1642 1599 system("sync"); … … 1708 1665 1709 1666 if (!strncmp(drive, RAID_DEVICE_STUB, strlen(RAID_DEVICE_STUB))) { 1710 mr_asprintf(tmp, "Not partitioning %s - it is a virtual drive", drive); 1711 log_it(tmp); 1712 mr_free(tmp); 1713 1667 log_it("Not partitioning %s - it is a virtual drive", drive); 1714 1668 return (0); 1715 1669 } … … 1725 1679 1726 1680 if (is_this_device_mounted(partition_name)) { 1727 mr_asprintf(tmp, "%s is mounted, and should not be partitioned", partition_name); 1728 log_to_screen(tmp); 1729 mr_free(tmp); 1681 log_to_screen("%s is mounted, and should not be partitioned", partition_name); 1730 1682 mr_free(partition_name); 1731 1683 return (1); … … 1769 1721 } 1770 1722 mr_strcat(output, "\n"); 1771 mr_asprintf(tmp,"PARTSIZE = +%ld",(long)partsize); 1772 log_it(tmp); 1773 mr_free(tmp); 1723 log_it("PARTSIZE = +%ld",(long)partsize); 1774 1724 1775 1725 log_it("---fdisk command---"); … … 1826 1776 format, -1); 1827 1777 if (res) { 1828 mr_asprintf(tmp, "Failed to vacuum-pack %s", partition_name); 1829 log_it(tmp); 1830 mr_free(tmp); 1778 log_it("Failed to vacuum-pack %s", partition_name); 1831 1779 1832 1780 retval++; … … 1840 1788 partsize); 1841 1789 if (retval) { 1842 mr_asprintf(tmp, "Partitioned %s but failed to set its type", partition_name); 1843 log_it(tmp); 1844 mr_free(tmp); 1790 log_it("Partitioned %s but failed to set its type", partition_name); 1845 1791 } else { 1846 1792 if (partsize > 0) { 1847 mr_asprintf(tmp, "Partition %s created+configured OK", partition_name); 1848 log_to_screen(tmp); 1849 mr_free(tmp); 1793 log_to_screen("Partition %s created+configured OK", partition_name); 1850 1794 } else { 1851 1795 log_it("Returning from a successful vacuum-pack"); … … 2425 2369 return; 2426 2370 } 2427 mr_asprintf(tmp, "Expanding entries to suit drive %s (%ld MB)", drive_name, current_size_of_drive); 2428 log_to_screen(tmp); 2429 mr_free(tmp); 2371 log_to_screen("Expanding entries to suit drive %s (%ld MB)", drive_name, current_size_of_drive); 2430 2372 2431 2373 drivemntlist = malloc(sizeof(struct mountlist_reference)); … … 2445 2387 2446 2388 if (original_size_of_drive <= 0) { 2447 mr_asprintf(tmp, "Cannot resize %s's entries. Drive not found.", drive_name); 2448 log_to_screen(tmp); 2449 mr_free(tmp); 2389 log_to_screen("Cannot resize %s's entries. Drive not found.", drive_name); 2450 2390 return; 2451 2391 } 2452 2392 factor = (float) (current_size_of_drive) / (float) (original_size_of_drive); 2453 mr_asprintf(tmp, "Disk %s was %ld MB; is now %ld MB; factor = %f", drive_name, original_size_of_drive, current_size_of_drive, factor); 2454 log_to_screen(tmp); 2455 mr_free(tmp); 2393 log_to_screen("Disk %s was %ld MB; is now %ld MB; factor = %f", drive_name, original_size_of_drive, current_size_of_drive, factor); 2456 2394 2457 2395 lastpart = drivemntlist->entries - 1; … … 2478 2416 } 2479 2417 2480 mr_asprintf(tmp, "Changing %s from %lld KB to %ld KB", drivemntlist->el[partno]->device, drivemntlist->el[partno]->size, newsizL); 2481 log_to_screen(tmp); 2482 mr_free(tmp); 2418 log_to_screen("Changing %s from %lld KB to %ld KB", drivemntlist->el[partno]->device, drivemntlist->el[partno]->size, newsizL); 2483 2419 drivemntlist->el[partno]->size = newsizL; 2484 2420 } 2485 2421 final_size = get_phys_size_of_drive(drive_name); 2486 mr_asprintf(tmp, "final_size = %ld MB", final_size); 2487 log_to_screen(tmp); 2488 mr_free(tmp); 2422 log_to_screen("final_size = %ld MB", final_size); 2489 2423 } 2490 2424 -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-compare.c
r2323 r2324 79 79 insist_on_this_cd_number((++g_current_media_number)); 80 80 } else { 81 mr_asprintf(tmp_ptr, "No CD's left. No biggiefiles left. No prob, Bob."); 82 log_msg(2, tmp_ptr); 83 paranoid_free(tmp_ptr); 81 log_msg(2, "No CD's left. No biggiefiles left. No prob, Bob."); 84 82 return (0); 85 83 } 86 84 } 87 85 if (!(fin = fopen(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""), "r"))) { 88 mr_asprintf(tmp_ptr, "Cannot open bigfile %ld (%s)'s info file", bigfileno + 1, bigfile_fname_ptr); 89 log_to_screen(tmp_ptr); 90 paranoid_free(tmp_ptr); 86 log_to_screen("Cannot open bigfile %ld (%s)'s info file", bigfileno + 1, bigfile_fname_ptr); 91 87 return (1); 92 88 } -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c
r2323 r2324 272 272 if (!bkpinfo->isodir[0]) { 273 273 mr_free(bkpinfo->isodir); 274 mr_asprintf(p, "/tmp/isodir"); 275 bkpinfo->isodir = p; 274 mr_asprintf(bkpinfo->isodir, "/tmp/isodir"); 276 275 } 277 276 /* End patch */ … … 498 497 "Again with the /proc - why is this in your mountlist?"); 499 498 } else if (is_this_device_mounted(mountlist->el[lino].device)) { 500 mr_asprintf(tmp, "%s is already mounted", mountlist->el[lino].device); 501 log_to_screen(tmp); 502 mr_free(tmp); 499 log_to_screen("%s is already mounted", mountlist->el[lino].device); 503 500 } else if (strcmp(mountlist->el[lino].mountpoint, "none") 504 501 && strcmp(mountlist->el[lino].mountpoint, "lvm") … … 595 592 if (!strcmp(bkpinfo->isodir, "/") && am_I_in_disaster_recovery_mode()) { 596 593 mr_free(bkpinfo->isodir); 597 mr_asprintf(p, "/tmp/isodir"); 598 bkpinfo->isodir = p; 594 mr_asprintf(bkpinfo->isodir, "/tmp/isodir"); 599 595 log_msg(1, "isodir is being set to %s", bkpinfo->isodir); 600 596 } … … 772 768 mr_free(bkpinfo->prefix); 773 769 if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) { 774 mr_asprintf(tmp1, "%s", value); 775 } else { 776 mr_asprintf(tmp1, "%s", STD_PREFIX); 777 } 778 bkpinfo->prefix = tmp1; 770 mr_asprintf(bkpinfo->prefix, "%s", value); 771 } else { 772 mr_asprintf(bkpinfo->prefix, "%s", STD_PREFIX); 773 } 779 774 } else if (!strcmp(value, "nfs")) { 780 775 bkpinfo->backup_media_type = nfs; … … 782 777 mr_free(bkpinfo->prefix); 783 778 if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) { 784 mr_asprintf(tmp1, "%s", value); 785 } else { 786 mr_asprintf(tmp1, "%s", STD_PREFIX); 787 } 788 bkpinfo->prefix = tmp1; 779 mr_asprintf(bkpinfo->prefix, "%s", value); 780 } else { 781 mr_asprintf(bkpinfo->prefix, "%s", STD_PREFIX); 782 } 789 783 790 784 if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "pxe")) { … … 796 790 } 797 791 mr_free(bkpinfo->prefix); 798 mr_asprintf(tmp1, "%s", envtmp1); 799 bkpinfo->prefix = tmp1; 792 mr_asprintf(bkpinfo->prefix, "%s", envtmp1); 800 793 } 801 794 … … 970 963 read_cfg_var(g_mondo_cfg_file, "isodir", iso_path); 971 964 mr_free(bkpinfo->isodir); 972 mr_asprintf(tmp1, "%s%s", iso_mnt, iso_path); 973 bkpinfo->isodir = tmp1; 965 mr_asprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path); 974 966 if (!bkpinfo->isodir[0]) { 975 967 mr_free(bkpinfo->isodir); … … 2012 2004 } 2013 2005 mr_asprintf(tmp, "Unmounting device %s ", mountlist->el[lino].device); 2014 2015 2006 update_progress_form(tmp); 2016 2007 … … 2194 2185 } 2195 2186 mr_asprintf(tmp, "%s", bkpinfo->media_device); 2196 if (extract_cfg_file_and_mountlist_from_tape_dev 2197 (bkpinfo->media_device)) { 2187 if (extract_cfg_file_and_mountlist_from_tape_dev (bkpinfo->media_device)) { 2198 2188 strcpy(bkpinfo->media_device, "/dev/st0"); 2199 if (extract_cfg_file_and_mountlist_from_tape_dev 2200 (bkpinfo->media_device)) { 2189 if (extract_cfg_file_and_mountlist_from_tape_dev (bkpinfo->media_device)) { 2201 2190 strcpy(bkpinfo->media_device, "/dev/osst0"); 2202 if (extract_cfg_file_and_mountlist_from_tape_dev 2203 (bkpinfo->media_device)) { 2191 if (extract_cfg_file_and_mountlist_from_tape_dev (bkpinfo->media_device)) { 2204 2192 strcpy(bkpinfo->media_device, "/dev/ht0"); 2205 if (extract_cfg_file_and_mountlist_from_tape_dev 2206 (bkpinfo->media_device)) { 2207 log_msg(3, 2208 "I tried lots of devices but none worked."); 2193 if (extract_cfg_file_and_mountlist_from_tape_dev (bkpinfo->media_device)) { 2194 log_msg(3, "I tried lots of devices but none worked."); 2209 2195 strcpy(bkpinfo->media_device, tmp); 2210 2196 } … … 2343 2329 /* @} - end restoreUtilityGroup */ 2344 2330 2345 2346 /***************************************************************************2347 * F@ *2348 * () -- Hugo Rabson *2349 * *2350 * Purpose: *2351 * *2352 * Called by: *2353 * Params: - - *2354 * Returns: 0=success; nonzero=failure *2355 ***************************************************************************/2356 2357 2358 2359 2331 void wait_until_software_raids_are_prepped(char *mdstat_file, 2360 2332 int wait_for_percentage) -
branches/2.2.10/mondo/src/mondorestore/mondorestore.c
r2323 r2324 918 918 popup_and_OK(tmp); 919 919 mr_free(tmp); 920 log_to_screen 921 ("Mondo has restored your system. Please wait for the command prompt."); 922 log_to_screen 923 ("Then remove the backup media and reboot."); 924 log_to_screen 925 ("Please visit our website at http://www.mondorescue.org for more information."); 920 log_to_screen("Mondo has restored your system. Please wait for the command prompt."); 921 log_to_screen("Then remove the backup media and reboot."); 922 log_to_screen("Please visit our website at http://www.mondorescue.org for more information."); 926 923 } 927 924 g_I_have_just_nuked = TRUE; … … 1159 1156 use_ntfsprog_hack = TRUE; 1160 1157 log_msg(2, "Calling ntfsclone in background because %s is an NTFS /dev entry", outfile_fname); 1161 mr_asprintf(sz_devfile, "/tmp/%d.%d.000", (int) (random() % 32768), 1162 (int) (random() % 32768)); 1158 mr_asprintf(sz_devfile, "/tmp/%d.%d.000", (int) (random() % 32768), (int) (random() % 32768)); 1163 1159 mkfifo(sz_devfile, 0x770); 1164 1160 strcpy(ntfsprog_fifo, sz_devfile); … … 1232 1228 mr_free(mds); 1233 1229 1234 mr_asprintf(tmp, "Restoring from %s #%d", mds, g_current_media_number); 1235 log_to_screen(tmp); 1236 mr_free(tmp); 1230 log_to_screen("Restoring from %s #%d", mds, g_current_media_number); 1237 1231 1238 1232 insist_on_this_cd_number(g_current_media_number); … … 1279 1273 mr_free(tmp); 1280 1274 if (bzip2_command != NULL) { 1281 mr_strcat(bzip2_command, " -dc %s 2>> %s", 1282 slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE); 1275 mr_strcat(bzip2_command, " -dc %s 2>> %s", slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE); 1283 1276 } else { 1284 mr_asprintf(bzip2_command, "cat %s 2>> %s", 1285 slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE); 1277 mr_asprintf(bzip2_command, "cat %s 2>> %s", slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE); 1286 1278 } 1287 1279 mds = media_descriptor_string(bkpinfo->backup_media_type); … … 1627 1619 char *executable = NULL; 1628 1620 char *temp_log = NULL; 1629 char *screen_message = NULL;1630 1621 long matches = 0; 1631 1622 bool use_star; … … 1654 1645 log_msg(3, "length_of_file(%s) = %llu", tarball_fname, length_of_file(tarball_fname)); 1655 1646 log_msg(3, "count_lines_in_file(%s) = %llu", tarball_fname, count_lines_in_file(tarball_fname)); 1656 mr_asprintf(tmp, "Unable to restore fileset #%ld (CD I/O error)", current_tarball_number); 1657 log_to_screen(tmp); 1658 mr_free(tmp); 1647 log_to_screen("Unable to restore fileset #%ld (CD I/O error)", current_tarball_number); 1659 1648 mr_free(filelist_name); 1660 1649 log_msg(5, "Leaving"); … … 1672 1661 log_msg(3, "Saved fileset %ld's subset to %s", current_tarball_number, filelist_subset_fname); 1673 1662 } 1674 mr_asprintf(screen_message, "Tarball #%ld --- %ld matches", current_tarball_number, matches); 1675 log_to_screen(screen_message); 1676 mr_free(screen_message); 1663 log_to_screen("Tarball #%ld --- %ld matches", current_tarball_number, matches); 1677 1664 } 1678 1665 mr_free(filelist_name); … … 2066 2053 } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) { 2067 2054 insist_on_this_cd_number(++g_current_media_number); 2068 mr_asprintf(tmp1, "Restoring from %s #%d", mds, g_current_media_number); 2069 log_to_screen(tmp1); 2070 mr_free(tmp1); 2055 log_to_screen("Restoring from %s #%d", mds, g_current_media_number); 2071 2056 just_changed_cds = TRUE; 2072 2057 } else { … … 2228 2213 } else { 2229 2214 mr_asprintf(progress_str, "Restoring from fileset #%ld on %s #%d", current_tarball_number, mds, g_current_media_number); 2230 for (res = 999, attempts = 0; attempts < 3 && res != 0; 2231 attempts++) { 2232 res = 2233 restore_a_tarball_from_CD(tarball_fname, 2234 current_tarball_number, 2235 filelist); 2215 for (res = 999, attempts = 0; attempts < 3 && res != 0; attempts++) { 2216 res = restore_a_tarball_from_CD(tarball_fname, current_tarball_number, filelist); 2236 2217 } 2237 2218 mr_asprintf(tmp1, "%s #%d, fileset #%ld - restore ", mds, g_current_media_number, current_tarball_number); … … 2247 2228 } 2248 2229 strcpy(comment, tmp1); 2249 paranoid_free(tmp1);2230 mr_free(tmp1); 2250 2231 if (attempts > 1) { 2251 2232 log_to_screen(comment); … … 2519 2500 retval += res; 2520 2501 if (res) { 2521 mr_asprintf(tmp, "Fileset %ld - errors occurred", current_afioball_number); 2522 log_to_screen(tmp); 2523 mr_free(tmp); 2502 log_to_screen("Fileset %ld - errors occurred", current_afioball_number); 2524 2503 } 2525 2504 res = … … 2958 2937 log_msg(1, "Mounting nfs dir"); 2959 2938 mr_free(bkpinfo->isodir); 2960 mr_asprintf(tmp, "/tmp/isodir"); 2961 bkpinfo->isodir = tmp; 2939 mr_asprintf(bkpinfo->isodir, "/tmp/isodir"); 2962 2940 run_program_and_log_output("mkdir -p /tmp/isodir", 5); 2963 2941 mr_asprintf(tmp, "mount %s -t nfs -o nolock,ro /tmp/isodir", bkpinfo->nfs_mount); … … 2968 2946 2969 2947 if (retval) { 2970 log_to_screen 2971 ("Warning - load_raidtab_into_raidlist returned an error"); 2948 log_to_screen("Warning - load_raidtab_into_raidlist returned an error"); 2972 2949 } 2973 2950 … … 3079 3056 set_signals(FALSE); 3080 3057 log_to_screen("Restore log (%s) copied to /var/log on your hard disk", MONDO_LOGFILE); 3081 mr_asprintf(tmp, "Mondo-restore is exiting (retval=%d) ", retval); 3082 log_to_screen(tmp); 3083 mr_free(tmp); 3058 log_to_screen("Mondo-restore is exiting (retval=%d) ", retval); 3084 3059 3085 3060 mr_asprintf(tmp, "umount %s", bkpinfo->isodir);
Note:
See TracChangeset
for help on using the changeset viewer.