Changeset 2242 in MondoRescue
- Timestamp:
- Jun 29, 2009, 7:19:18 PM (16 years ago)
- Location:
- branches/2.2.9/mondo/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-archive.c
r2241 r2242 1586 1586 char *message_to_screen = NULL; 1587 1587 char *old_pwd; 1588 char *mds = NULL; 1588 1589 1589 1590 malloc_string(old_pwd); … … 1597 1598 (void)chdir(bkpinfo->scratchdir); 1598 1599 1599 m r_asprintf(&message_to_screen, "Copying data to make %s #%d",1600 media_descriptor_string(bkpinfo->backup_media_type),1601 g_current_media_number);1600 mds = media_descriptor_string(bkpinfo->backup_media_type); 1601 mr_asprintf(&message_to_screen, "Copying data to make %s #%d",mds, g_current_media_number); 1602 mr_free(mds); 1602 1603 log_msg(1, message_to_screen); 1603 1604 … … 1689 1690 char *tmp2; 1690 1691 char *tmp3; 1692 char *mds = NULL; 1691 1693 bool cd_is_mountable; 1692 1694 … … 1746 1748 log_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso); 1747 1749 sprintf(tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir); 1748 m r_asprintf(&message_to_screen, "Making an ISO (%s #%d)",1749 media_descriptor_string(bkpinfo->backup_media_type),1750 g_current_media_number);1750 mds = media_descriptor_string(bkpinfo->backup_media_type); 1751 mr_asprintf(&message_to_screen, "Making an ISO (%s #%d)", mds, g_current_media_number); 1752 mr_free(mds); 1751 1753 1752 1754 pause_and_ask_for_cdr(2, &cd_is_mountable); /* if g_current_media_number >= 2 then pause & ask */ … … 1843 1845 paranoid_free(message_to_screen); 1844 1846 } else { 1845 mr_asprintf(&message_to_screen, "Running mkisofs to make %s #%d", 1846 media_descriptor_string(bkpinfo->backup_media_type), 1847 g_current_media_number); 1847 mds = media_descriptor_string(bkpinfo->backup_media_type); 1848 mr_asprintf(&message_to_screen, "Running mkisofs to make %s #%d", mds, g_current_media_number); 1848 1849 log_msg(1, message_to_screen); 1849 mr_asprintf(&result_sz, "Call to mkisofs to make ISO (%s #%d) ", 1850 media_descriptor_string(bkpinfo->backup_media_type), 1851 g_current_media_number); 1850 mr_asprintf(&result_sz, "Call to mkisofs to make ISO (%s #%d) ", mds, g_current_media_number); 1851 mr_free(mds); 1852 1852 if (bkpinfo->nonbootable_backup) { 1853 1853 log_msg(1, "Making nonbootable backup"); … … 1925 1925 if (bkpinfo->call_burn_iso[0] != '\0') { 1926 1926 log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso); 1927 m r_asprintf(&message_to_screen, "Burning %s #%d",1928 media_descriptor_string(bkpinfo->backup_media_type),1929 g_current_media_number);1927 mds = media_descriptor_string(bkpinfo->backup_media_type); 1928 mr_asprintf(&message_to_screen, "Burning %s #%d", mds, g_current_media_number); 1929 mr_free(mds); 1930 1930 pause_and_ask_for_cdr(2, &cd_is_mountable); 1931 1931 res = … … 1945 1945 1946 1946 if (bkpinfo->call_after_iso[0] != '\0') { 1947 m r_asprintf(&message_to_screen, "Running post-ISO call (%s #%d)",1948 media_descriptor_string(bkpinfo->backup_media_type),1949 g_current_media_number);1947 mds = media_descriptor_string(bkpinfo->backup_media_type); 1948 mr_asprintf(&message_to_screen, "Running post-ISO call (%s #%d)", mds, g_current_media_number); 1949 mr_free(mds); 1950 1950 res = 1951 1951 eval_call_to_make_ISO(bkpinfo->call_after_iso, … … 2052 2052 assert_string_is_neither_NULL_nor_zerolength(biggielist_fname); 2053 2053 2054 malloc_string(bigfile_fname);2055 2054 estimated_total_noof_slices = 2056 2055 size_of_all_biggiefiles_K() / bkpinfo->optimal_set_size + 1; … … 2078 2077 return (1); 2079 2078 } 2079 2080 malloc_string(bigfile_fname); 2080 2081 for (fgets(bigfile_fname, MAX_STR_LEN, fin); !feof(fin); 2081 2082 fgets(bigfile_fname, MAX_STR_LEN, fin), biggie_file_number++) { … … 2759 2760 char *szserfname; 2760 2761 char *szunmount; 2762 char *mds = NULL; 2761 2763 2762 2764 malloc_string(tmp); … … 2769 2771 malloc_string(szunmount); 2770 2772 2771 sprintf(szmsg, "I am about to burn %s #%d",2772 media_descriptor_string(g_backup_media_type),2773 g_current_media_number);2773 mds = media_descriptor_string(g_backup_media_type); 2774 sprintf(szmsg, "I am about to burn %s #%d", mds, g_current_media_number); 2775 mr_free(mds); 2774 2776 log_to_screen(szmsg); 2775 2777 if (g_current_media_number < ask_for_one_if_more_than_this) { … … 2812 2814 } else if (!does_file_exist(szcdno) 2813 2815 || !does_file_exist(szserfname)) { 2816 mds = media_descriptor_string(g_backup_media_type); 2814 2817 log_to_screen 2815 ("%s has data on it but it's probably not a Mondo CD.", 2816 media_descriptor_string(g_backup_media_type));2818 ("%s has data on it but it's probably not a Mondo CD.", mds); 2819 mr_free(mds); 2817 2820 } else { 2818 log_to_screen("%s found in drive. It's a Mondo disk.", 2819 media_descriptor_string(g_backup_media_type)); 2821 mds = media_descriptor_string(g_backup_media_type); 2822 log_to_screen("%s found in drive. It's a Mondo disk.", mds); 2823 mr_free(mds); 2824 2820 2825 cd_number = atoi(last_line_of_file(szcdno)); 2821 2826 sprintf(tmp, "cat %s 2> /dev/null", szserfname); … … 2830 2835 our_serial_str, g_serial_string); 2831 2836 if (cd_number > 0 && !strcmp(our_serial_str, g_serial_string)) { 2832 log_msg(2, "This %s is part of this backup set!",2833 media_descriptor_string(g_backup_media_type));2837 mds = media_descriptor_string(g_backup_media_type); 2838 log_msg(2, "This %s is part of this backup set!", mds); 2834 2839 ok_go_ahead_burn_it = FALSE; 2835 2840 if (cd_number == g_current_media_number - 1) { 2836 log_to_screen 2837 ("I think you've left the previous %s in the drive.", 2838 media_descriptor_string(g_backup_media_type)); 2841 log_to_screen("I think you've left the previous %s in the drive.", mds); 2839 2842 } else { 2840 log_to_screen 2841 ("Please remove this %s. It is part of the backup set you're making now.", 2842 media_descriptor_string(g_backup_media_type)); 2843 log_to_screen("Please remove this %s. It is part of the backup set you're making now.", mds); 2843 2844 } 2845 mr_free(mds); 2846 2844 2847 } else { 2845 2848 log_to_screen("...but not part of _our_ backup set."); … … 2847 2850 mr_free(our_serial_str); 2848 2851 } else { 2852 mds = media_descriptor_string(g_backup_media_type); 2849 2853 log_msg(2, 2850 "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?", 2851 media_descriptor_string(g_backup_media_type)); 2854 "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?", mds); 2852 2855 if (interrogate_disk_currently_in_cdrw_drive(cdrw_dev, FALSE)) { 2853 2856 ok_go_ahead_burn_it = FALSE; 2854 log_to_screen("There isn't a writable %s in the drive.", 2855 media_descriptor_string(g_backup_media_type)); 2856 } 2857 } 2858 2859 /* 2860 if (g_current_media_number > ask_for_one_if_more_than_this) 2861 { 2862 ok_go_ahead_burn_it = FALSE; 2863 log_it("paafcd: %d > %d, so I'll definitely pause.", g_current_media_number > ask_for_one_if_more_than_this); 2864 } 2865 */ 2857 log_to_screen("There isn't a writable %s in the drive.", mds); 2858 } 2859 mr_free(mds); 2860 } 2866 2861 2867 2862 if (!ok_go_ahead_burn_it) { 2868 2863 eject_device(cdrom_dev); 2864 mds = media_descriptor_string(g_backup_media_type); 2869 2865 sprintf(tmp, 2870 "I am about to burn %s #%d of the backup set. Please insert %s and press Enter.", 2871 m edia_descriptor_string(g_backup_media_type),2872 g_current_media_number,2873 media_descriptor_string(g_backup_media_type)); 2866 "I am about to burn %s #%d of the backup set. Please insert %s and press Enter.", 2867 mds, g_current_media_number, mds); 2868 mr_free(mds); 2869 2874 2870 popup_and_OK(tmp); 2875 2871 goto gotos_make_me_puke; … … 2878 2874 } 2879 2875 2876 mds = media_descriptor_string(g_backup_media_type); 2880 2877 log_msg(2, 2881 "paafcd: OK, I assume I have a blank/reusable %s in the drive...", 2882 media_descriptor_string(g_backup_media_type)); 2878 "paafcd: OK, I assume I have a blank/reusable %s in the drive...", mds); 2883 2879 2884 2880 // if (ask_for_one_if_more_than_this>1) { popup_and_OK(szmsg); } 2885 2881 2886 log_to_screen("Proceeding w/ %s in drive.", 2887 media_descriptor_string(g_backup_media_type)); 2882 log_to_screen("Proceeding w/ %s in drive.", mds); 2883 mr_free(mds); 2884 2888 2885 paranoid_free(tmp); 2889 2886 paranoid_free(szmsg); … … 3369 3366 char *lastcd_fname; 3370 3367 char *isofile; 3368 char *mds = NULL; 3371 3369 3372 3370 /*@ bool ******************************************************** */ … … 3388 3386 } 3389 3387 3390 log_msg(1, "OK, time to make %s #%d",3391 media_descriptor_string(bkpinfo->backup_media_type),3392 g_current_media_number);3388 mds = media_descriptor_string(bkpinfo->backup_media_type); 3389 log_msg(1, "OK, time to make %s #%d", mds, g_current_media_number); 3390 mr_free(mds); 3393 3391 3394 3392 /* label the ISO with its number */ … … 3447 3445 } 3448 3446 if (bkpinfo->verify_data && !res) { 3447 mds = media_descriptor_string(g_backup_media_type); 3449 3448 log_to_screen 3450 ("Please reboot from the 1st %s in Compare Mode, as a precaution.", 3451 media_descriptor_string(g_backup_media_type));3449 ("Please reboot from the 1st %s in Compare Mode, as a precaution.", mds); 3450 mr_free(mds); 3452 3451 chdir("/"); 3453 3452 log_it("Before calling verification of image()"); … … 3462 3461 that_one_was_ok = TRUE; 3463 3462 } else { 3464 sprintf(tmp, "Failed to create %s #%d. Retry?",3465 media_descriptor_string(bkpinfo->backup_media_type),3466 g_current_media_number);3463 mds = media_descriptor_string(bkpinfo->backup_media_type); 3464 sprintf(tmp, "Failed to create %s #%d. Retry?", mds, g_current_media_number); 3465 mr_free(mds); 3467 3466 res = ask_me_yes_or_no(tmp); 3468 3467 if (!res) { … … 3525 3524 int res = 0, retval = 0, cdno = 0; 3526 3525 char *tmp; 3526 char *mds = NULL; 3527 3527 long diffs = 0; 3528 3528 … … 3564 3564 retval += res; 3565 3565 if (res) { 3566 mds = media_descriptor_string(bkpinfo->backup_media_type); 3566 3567 sprintf(tmp, 3567 "Warnings/errors were reported while checking %s #%d", 3568 media_descriptor_string(bkpinfo->backup_media_type), 3569 g_current_media_number); 3568 "Warnings/errors were reported while checking %s #%d", mds, g_current_media_number); 3569 mr_free(mds); 3570 3570 log_to_screen(tmp); 3571 3571 -
branches/2.2.9/mondo/src/common/libmondo-devices.c
r2241 r2242 1359 1359 /*@ buffers ********************************************************* */ 1360 1360 char *tmp; 1361 char *mds = NULL; 1361 1362 char *request; 1362 1363 … … 1410 1411 log_msg(3, "Currently, we hold %d but we want %d", res, 1411 1412 cd_number_i_want); 1412 sprintf(tmp, "Insisting on %s #%d", 1413 media_descriptor_string(bkpinfo->backup_media_type), 1414 cd_number_i_want); 1415 sprintf(request, "Please insert %s #%d and press Enter.", 1416 media_descriptor_string(bkpinfo->backup_media_type), 1417 cd_number_i_want); 1413 mds = media_descriptor_string(bkpinfo->backup_media_type); 1414 sprintf(tmp, "Insisting on %s #%d", mds, cd_number_i_want); 1415 sprintf(request, "Please insert %s #%d and press Enter.", mds, cd_number_i_want); 1416 mr_free(mds); 1418 1417 log_msg(3, tmp); 1419 1418 while (what_number_cd_is_this() != cd_number_i_want) { … … 1470 1469 { 1471 1470 char *tmp = NULL; 1471 char *mds = NULL; 1472 1472 char *sz_size; 1473 1473 char *command; … … 1534 1534 finish(1); 1535 1535 } 1536 sprintf(comment, "What speed is your %s (re)writer?",1537 media_descriptor_string(bkpinfo->backup_media_type));1536 mds = media_descriptor_string(bkpinfo->backup_media_type); 1537 sprintf(comment, "What speed is your %s (re)writer?", mds); 1538 1538 if (bkpinfo->backup_media_type == dvd) { 1539 1539 find_dvd_device(bkpinfo->media_device, FALSE); … … 1557 1557 1558 1558 sprintf(comment, 1559 "How much data (in Megabytes) will each %s store?", 1560 media_descriptor_string(bkpinfo->backup_media_type));1559 "How much data (in Megabytes) will each %s store?", mds); 1560 mr_free(mds); 1561 1561 if (!popup_and_get_string("Size", comment, sz_size, 5)) { 1562 1562 log_to_screen("User has chosen not to backup the PC"); … … 1573 1573 /* No break because we continue even for usb */ 1574 1574 case cdstream: 1575 mds = media_descriptor_string(bkpinfo->backup_media_type); 1576 1575 1577 if ((bkpinfo->disaster_recovery) && (bkpinfo->backup_media_type != usb)) { 1576 1578 strcpy(bkpinfo->media_device, "/dev/cdrom"); … … 1589 1591 bkpinfo->media_device); 1590 1592 sprintf(comment, 1591 "Please specify your %s drive's /dev entry", 1592 media_descriptor_string(bkpinfo->backup_media_type)); 1593 "Please specify your %s drive's /dev entry", mds); 1593 1594 if (!popup_and_get_string 1594 1595 ("Device?", comment, bkpinfo->media_device, … … 1598 1599 } 1599 1600 } 1600 log_msg(2, "%s device found at %s", 1601 media_descriptor_string(bkpinfo->backup_media_type), 1602 bkpinfo->media_device); 1601 log_msg(2, "%s device found at %s", mds, bkpinfo->media_device); 1603 1602 } else { 1604 1603 if ((find_cdrw_device(bkpinfo->media_device)) && (bkpinfo->backup_media_type != usb)) { … … 1608 1607 if (bkpinfo->backup_media_type == usb) { 1609 1608 mr_asprintf(&tmp, 1610 "I think your %s media corresponds to %s. Is this correct?", 1611 media_descriptor_string(bkpinfo->backup_media_type), 1609 "I think your %s media corresponds to %s. Is this correct?", mds, 1612 1610 bkpinfo->media_device); 1613 1611 } else { 1614 1612 mr_asprintf(&tmp, 1615 "I think I've found your %s burner at SCSI node %s. Is this correct? (Say no if you have an IDE burner and you are running a 2.6 kernel. You will then be prompted for further details.)", 1616 media_descriptor_string(bkpinfo->backup_media_type), 1613 "I think I've found your %s burner at SCSI node %s. Is this correct? (Say no if you have an IDE burner and you are running a 2.6 kernel. You will then be prompted for further details.)", mds, 1617 1614 bkpinfo->media_device); 1618 1615 } … … 1647 1644 } 1648 1645 } 1646 mr_free(mds); 1647 1649 1648 if (bkpinfo->backup_media_type == cdstream) { 1650 1649 for (i = 0; i <= MAX_NOOF_MEDIA; i++) { -
branches/2.2.9/mondo/src/common/libmondo-files.c
r2053 r2242 10 10 11 11 #include "my-stuff.h" 12 #include "mr_mem.h" 12 13 #include "mondostructures.h" 13 14 #include "libmondo-files.h" … … 1221 1222 /*@ buffers *************** */ 1222 1223 char tmp[MAX_STR_LEN]; 1224 char *mds = NULL; 1223 1225 1224 1226 /*@ long long ************* */ … … 1247 1249 } 1248 1250 if (scratchLL <= 1) { 1251 mds = media_descriptor_string(bkpinfo->backup_media_type); 1249 1252 sprintf(tmp, 1250 "Your backup will probably occupy a single %s. Maybe two.", 1251 media_descriptor_string(bkpinfo->backup_media_type));1253 "Your backup will probably occupy a single %s. Maybe two.", mds); 1254 mr_free(mds); 1252 1255 } else if (scratchLL > 4) { 1253 1256 sprintf(tmp, -
branches/2.2.9/mondo/src/common/libmondo-string.c
r2241 r2242 1092 1092 static char outstr[MAX_STR_LEN]; 1093 1093 char *pos_w_commas, *tmp; 1094 char *mds = NULL; 1094 1095 1095 1096 assert(bkpinfo != NULL); … … 1122 1123 (int) (space_occupied_by_cd(bkpinfo->scratchdir) * 100 / 1024 / 1123 1124 bkpinfo->media_size[g_current_media_number]); 1124 sprintf(outstr, "%s %d: [",1125 media_descriptor_string(bkpinfo->backup_media_type),1126 g_current_media_number);1125 mds = media_descriptor_string(bkpinfo->backup_media_type); 1126 sprintf(outstr, "%s %d: [", mds, g_current_media_number); 1127 mr_free(mds); 1127 1128 } 1128 1129 for (j = 0; j < percentage; j += 5) { … … 1146 1147 */ 1147 1148 /* BCO/BERLIOS change that function to allocate memory, return a pointer and modify caller to free the mem */ 1148 char *media_descriptor_string(t_bkptype type_of_bkp) 1149 { 1150 static char *type_of_backup = NULL; 1151 1152 if (!type_of_backup) { 1153 malloc_string(type_of_backup); 1154 } 1149 char *media_descriptor_string(t_bkptype type_of_bkp) { 1150 1151 char *type_of_backup = NULL; 1155 1152 1156 1153 switch (type_of_bkp) { 1157 1154 case dvd: 1158 strcpy(type_of_backup, "DVD");1155 mr_asprintf(&type_of_backup, "DVD"); 1159 1156 break; 1160 1157 case cdr: 1161 strcpy(type_of_backup, "CDR");1158 mr_asprintf(&type_of_backup, "CDR"); 1162 1159 break; 1163 1160 case cdrw: 1164 strcpy(type_of_backup, "CDRW");1161 mr_asprintf(&type_of_backup, "CDRW"); 1165 1162 break; 1166 1163 case tape: 1167 strcpy(type_of_backup, "tape");1164 mr_asprintf(&type_of_backup, "tape"); 1168 1165 break; 1169 1166 case cdstream: 1170 strcpy(type_of_backup, "CDR");1167 mr_asprintf(&type_of_backup, "CDR"); 1171 1168 break; 1172 1169 case udev: 1173 strcpy(type_of_backup, "udev");1170 mr_asprintf(&type_of_backup, "udev"); 1174 1171 break; 1175 1172 case iso: 1176 strcpy(type_of_backup, "ISO");1173 mr_asprintf(&type_of_backup, "ISO"); 1177 1174 break; 1178 1175 case nfs: 1179 strcpy(type_of_backup, "nfs");1176 mr_asprintf(&type_of_backup, "nfs"); 1180 1177 break; 1181 1178 case usb: 1182 strcpy(type_of_backup, "USB");1179 mr_asprintf(&type_of_backup, "USB"); 1183 1180 break; 1184 1181 default: 1185 strcpy(type_of_backup, "ISO");1182 mr_asprintf(&type_of_backup, "ISO"); 1186 1183 } 1187 1184 return (type_of_backup); -
branches/2.2.9/mondo/src/common/libmondo-verify.c
r2230 r2242 152 152 /*@ buffers ********************************************************* */ 153 153 char *tmp; 154 char *mds = NULL; 154 155 155 156 /*@ int ************************************************************* */ … … 183 184 } 184 185 } 185 sprintf(tmp, "Verifying %s #%d's tarballs", 186 media_descriptor_string(bkpinfo->backup_media_type), 187 g_current_media_number); 186 mds = media_descriptor_string(bkpinfo->backup_media_type); 187 sprintf(tmp, "Verifying %s #%d's tarballs", mds, g_current_media_number); 188 mr_free(mds); 189 188 190 open_evalcall_form(tmp); 189 191 … … 229 231 // char ca, cb; 230 232 char *command; 233 char *mds = NULL; 231 234 char *sz_exe; 232 235 static char *bufblkA = NULL; … … 282 285 283 286 log_it("before vsbf"); 284 sprintf(tmp, "Verifying %s#%d's big files", 285 media_descriptor_string(bkpinfo->backup_media_type), 286 g_current_media_number); 287 mds = media_descriptor_string(bkpinfo->backup_media_type); 288 sprintf(tmp, "Verifying %s#%d's big files", mds, g_current_media_number); 289 mr_free(mds); 290 287 291 open_evalcall_form(tmp); 288 292 log_it("after vsbf"); -
branches/2.2.9/mondo/src/mondorestore/mondo-rstr-compare.c
r2230 r2242 382 382 383 383 char *tarball_fname, *progress_str, *tmp; 384 char *mds = NULL; 384 385 long max_val; 385 386 … … 393 394 394 395 max_val = atol(tmp); 395 sprintf(progress_str, "Comparing with %s #%d ", 396 media_descriptor_string(bkpinfo->backup_media_type), 397 g_current_media_number); 396 mds = media_descriptor_string(bkpinfo->backup_media_type); 397 sprintf(progress_str, "Comparing with %s #%d ", mds, g_current_media_number); 398 398 399 399 open_progress_form("Comparing files", … … 440 440 log_msg(2, "OK, I think it's time for another CD..."); 441 441 g_current_media_number++; 442 sprintf(progress_str, "Comparing with %s #%d ", 443 media_descriptor_string(bkpinfo->backup_media_type), 444 g_current_media_number); 442 sprintf(progress_str, "Comparing with %s #%d ", mds, g_current_media_number); 445 443 log_to_screen(progress_str); 446 444 } else { … … 451 449 } 452 450 } 451 mr_free(mds); 452 453 453 close_progress_form(); 454 454 if (retval) { -
branches/2.2.9/mondo/src/mondorestore/mondo-rstr-tools.c
r2230 r2242 279 279 char *mount_isodir_command = NULL; 280 280 char *tmp, *command; 281 char *mds = NULL; 281 282 int retval = 0, i; 282 283 bool already_mounted = FALSE; … … 331 332 } 332 333 i = what_number_cd_is_this(); /* has the side-effect of calling mount_media() */ 333 sprintf(tmp, "%s #%d has been mounted via loopback mount", 334 media_descriptor_string(bkpinfo->backup_media_type), i); 334 mds = media_descriptor_string(bkpinfo->backup_media_type); 335 sprintf(tmp, "%s #%d has been mounted via loopback mount", mds, i); 336 mr_free(mds); 337 335 338 log_msg(1, tmp); 336 339 if (i < 0) { -
branches/2.2.9/mondo/src/mondorestore/mondorestore.c
r2230 r2242 1075 1075 char *bigblk; 1076 1076 char *p; 1077 char *mds = NULL; 1077 1078 int retval = 0; 1078 1079 int finished = FALSE; … … 1242 1243 g_current_media_number); 1243 1244 g_current_media_number++; 1245 mds = media_descriptor_string(bkpinfo->backup_media_type); 1244 1246 sprintf(tmp, 1245 "Asking for %s #%d so that I may read slice #%ld\n", 1246 media_descriptor_string(bkpinfo->backup_media_type), 1247 "Asking for %s #%d so that I may read slice #%ld\n", mds, 1247 1248 g_current_media_number, sliceno); 1248 1249 log_msg(2, tmp); 1249 sprintf(tmp, "Restoring from %s #%d", 1250 media_descriptor_string(bkpinfo->backup_media_type),1251 g_current_media_number); 1250 sprintf(tmp, "Restoring from %s #%d", mds, g_current_media_number); 1251 mr_free(mds); 1252 1252 1253 log_to_screen(tmp); 1253 1254 insist_on_this_cd_number(g_current_media_number); … … 1301 1302 suffix), MONDO_LOGFILE); 1302 1303 } 1303 sprintf(tmp, "Working on %s #%d, file #%ld, slice #%ld ",1304 media_descriptor_string(bkpinfo->backup_media_type),1304 mds = media_descriptor_string(bkpinfo->backup_media_type); 1305 sprintf(tmp, "Working on %s #%d, file #%ld, slice #%ld ", mds, 1305 1306 g_current_media_number, bigfileno + 1, sliceno); 1307 mr_free(mds); 1306 1308 log_msg(2, tmp); 1307 1309 … … 1912 1914 /** malloc add ***/ 1913 1915 char *tmp; 1916 char *mds = NULL; 1914 1917 char *command; 1915 1918 char *afio_fname; … … 1932 1935 /* to do it with a file... */ 1933 1936 use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE; 1937 mds = media_descriptor_string(bkpinfo->backup_media_type); 1934 1938 sprintf(tmp, 1935 1939 "Restoring from fileset #%ld (%ld KB) on %s #%d", 1936 current_tarball_number, (long) size >> 10, 1937 media_descriptor_string(bkpinfo->backup_media_type),1938 g_current_media_number); 1940 current_tarball_number, (long) size >> 10, mds, g_current_media_number); 1941 mr_free(mds); 1942 1939 1943 log_msg(2, tmp); 1940 1944 run_program_and_log_output("mkdir -p " MNT_RESTORING "/tmp", FALSE); … … 2101 2105 /** malloc **/ 2102 2106 char *tmp; 2107 char *mds = NULL; 2103 2108 bool just_changed_cds = FALSE; 2104 2109 char *xattr_fname; … … 2149 2154 log_msg(3, 2150 2155 "...but its first slice isn't on this CD. Perhaps this was a selective restore?"); 2156 mds = media_descriptor_string(bkpinfo->backup_media_type); 2151 2157 log_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d", 2152 bigfileno + 1, 2153 media_descriptor_string(bkpinfo->backup_media_type), 2158 bigfileno + 1, mds, 2154 2159 g_current_media_number); 2155 2160 log_msg(3, "Slicename would have been %s", … … 2162 2167 } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) { 2163 2168 insist_on_this_cd_number(++g_current_media_number); 2164 sprintf(tmp, "Restoring from %s #%d", 2165 media_descriptor_string(bkpinfo->backup_media_type), 2169 sprintf(tmp, "Restoring from %s #%d", mds, 2166 2170 g_current_media_number); 2167 2171 log_to_screen(tmp); … … 2176 2180 bigfileno++; 2177 2181 } 2182 mr_free(mds); 2178 2183 } else { 2179 2184 just_changed_cds = FALSE; … … 2251 2256 /**malloc ***/ 2252 2257 char *tmp = NULL; 2258 char *mds = NULL; 2253 2259 char *tmp1 = NULL; 2254 2260 char *tarball_fname; … … 2275 2281 paranoid_free(tmp); 2276 2282 2277 sprintf(progress_str, "Restoring from %s #%d",2278 media_descriptor_string(bkpinfo->backup_media_type),2279 g_current_media_number); 2283 mds = media_descriptor_string(bkpinfo->backup_media_type); 2284 sprintf(progress_str, "Restoring from %s #%d", mds, g_current_media_number); 2285 2280 2286 log_to_screen(progress_str); 2281 2287 open_progress_form("Restoring from archives", … … 2327 2333 } else { 2328 2334 sprintf(progress_str, "Restoring from fileset #%ld on %s #%d", 2329 current_tarball_number, 2330 media_descriptor_string(bkpinfo->backup_media_type), 2331 g_current_media_number); 2335 current_tarball_number, mds, g_current_media_number); 2332 2336 // log_msg(3, "progress_str = %s", progress_str); 2333 2337 for (res = 999, attempts = 0; attempts < 3 && res != 0; … … 2339 2343 } 2340 2344 mr_asprintf(&tmp1, "%s #%d, fileset #%ld - restore ", 2341 media_descriptor_string(bkpinfo->backup_media_type), 2342 g_current_media_number, current_tarball_number); 2345 mds, g_current_media_number, current_tarball_number); 2343 2346 if (res) { 2344 2347 mr_strcat(tmp1, "reported errors"); … … 2362 2365 } 2363 2366 } 2367 mr_free(mds); 2368 2364 2369 close_progress_form(); 2365 2370 if (retval) { … … 2576 2581 /** malloc **/ 2577 2582 char *tmp; 2583 char *mds = NULL; 2578 2584 char *progress_str; 2579 2585 char *tmp_fname; … … 2661 2667 current_afioball_number++; 2662 2668 g_current_progress++; 2669 mds = media_descriptor_string(bkpinfo->backup_media_type), 2663 2670 sprintf(progress_str, "Restoring from fileset #%ld on %s #%d", 2664 current_afioball_number, 2665 media_descriptor_string(bkpinfo->backup_media_type), 2671 current_afioball_number, mds, 2666 2672 g_current_media_number); 2673 mr_free(mds); 2667 2674 res = 2668 2675 read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
Note:
See TracChangeset
for help on using the changeset viewer.