Changeset 2313 in MondoRescue for branches/2.2.10/mondo/src/common
- Timestamp:
- Aug 18, 2009, 2:29:11 PM (16 years ago)
- Location:
- branches/2.2.10/mondo/src/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-archive.c
r2303 r2313 1407 1407 if (!get_bit_N_of_array 1408 1408 (p_list_of_fileset_flags, storing_set_no)) { 1409 misc_counter_that_is_not_important = 1410 (misc_counter_that_is_not_important + 1) % 5; 1411 /* BCO the media_usage_comment is not really initialized there ! 1412 if (!misc_counter_that_is_not_important) { 1413 update_progress_form(media_usage_comment); 1414 } 1415 */ 1416 sleep(1); 1409 misc_counter_that_is_not_important = (misc_counter_that_is_not_important + 1) % 5; 1410 sleep(1); 1417 1411 } else { 1418 1412 // store set N … … 1434 1428 sleep(5); 1435 1429 } 1436 mr_asprintf(&media_usage_comment, "%s", percent_media_full_comment());1437 1430 /* copy to CD (scratchdir) ... and an actual CD-R if necessary */ 1438 1431 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { … … 1474 1467 retval += res; 1475 1468 g_current_progress++; 1469 1470 media_usage_comment = percent_media_full_comment(); 1476 1471 update_progress_form(media_usage_comment); 1477 1472 mr_free(media_usage_comment); … … 2215 2210 } 2216 2211 2217 mr_asprintf(&media_usage_comment, "%s", percent_media_full_comment());2218 2219 2212 /* copy to CD (scratchdir) ... and an actual CD-R if necessary */ 2220 2213 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { … … 2258 2251 retval += res; 2259 2252 g_current_progress++; 2253 2254 media_usage_comment = percent_media_full_comment(); 2260 2255 update_progress_form(media_usage_comment); 2261 2256 mr_free(media_usage_comment); … … 3034 3029 mr_asprintf(&curr_slice_fname_compressed, "%s", slice_fname(biggie_file_number, slice_num, bkpinfo->tmpdir, suffix)); 3035 3030 3036 mr_asprintf(&tmp, "%s", percent_media_full_comment()); 3031 3032 tmp = percent_media_full_comment(); 3037 3033 update_progress_form(tmp); 3038 paranoid_free(tmp);3034 mr_free(tmp); 3039 3035 3040 3036 if (!(fout = fopen(curr_slice_fname_uncompressed, "w"))) { -
branches/2.2.10/mondo/src/common/libmondo-string.c
r2287 r2313 155 155 tmp[j - 6] = ','; 156 156 strcpy(tmp + j - 5, pos_w_commas + j - 6); 157 // tmp[j-2] = ',';158 // strcpy(tmp+j-1, pos_w_commas+j-3);159 157 strcpy(pos_w_commas, tmp); 160 158 } … … 1087 1085 /*@ int *********************************************** */ 1088 1086 int percentage; 1089 int j;1090 1087 1091 1088 /*@ buffers ******************************************* */ 1092 static char outstr[MAX_STR_LEN];1089 char *outstr = NULL; 1093 1090 char *pos_w_commas, *tmp; 1094 1091 char *mds = NULL; 1095 1092 1096 1093 assert(bkpinfo != NULL); 1097 malloc_string(pos_w_commas); 1098 malloc_string(tmp); 1099 sprintf(tmp, "%lld", g_tape_posK); 1100 strcpy(pos_w_commas, commarize(tmp)); 1101 1102 1103 1104 if (bkpinfo->media_size[g_current_media_number] <= 0) 1105 // { fatal_error( "percentage_media_full_comment() - unknown media size"); } 1106 { 1107 sprintf(outstr, "Volume %d: %s kilobytes archived so far", 1108 g_current_media_number, pos_w_commas); 1094 1095 if (bkpinfo->media_size[g_current_media_number] <= 0) { 1096 malloc_string(pos_w_commas); 1097 malloc_string(tmp); 1098 sprintf(tmp, "%lld", g_tape_posK); 1099 strcpy(pos_w_commas, commarize(tmp)); 1100 paranoid_free(tmp); 1101 mr_asprintf(&outstr, "Volume %d: %s kilobytes archived so far", g_current_media_number, pos_w_commas); 1102 paranoid_free(pos_w_commas); 1109 1103 return (outstr); 1110 1104 } … … 1118 1112 percentage = 100; 1119 1113 } 1120 sprintf(outstr, "Volume %d: [", g_current_media_number);1114 mr_asprintf(&outstr, "Volume %d: [", g_current_media_number); 1121 1115 } else { 1122 1116 percentage = … … 1124 1118 bkpinfo->media_size[g_current_media_number]); 1125 1119 mds = media_descriptor_string(bkpinfo->backup_media_type); 1126 sprintf(outstr, "%s %d: [", mds, g_current_media_number);1120 mr_asprintf(&outstr, "%s %d: [", mds, g_current_media_number); 1127 1121 mr_free(mds); 1128 1122 } 1129 1123 for (j = 0; j < percentage; j += 5) { 1130 strcat(outstr, "*");1124 mr_strcat(outstr, "*"); 1131 1125 } 1132 1126 for (; j < 100; j += 5) { 1133 strcat(outstr, "."); 1134 } 1135 j = (int) strlen(outstr); 1136 sprintf(outstr + j, "] %d%% used", percentage); 1137 paranoid_free(pos_w_commas); 1138 paranoid_free(tmp); 1127 mr_strcat(outstr, "."); 1128 } 1129 mr_strcat(outstr, "] %d%% used", percentage); 1139 1130 return (outstr); 1140 1131 }
Note:
See TracChangeset
for help on using the changeset viewer.