- Timestamp:
- Jan 24, 2012, 2:45:39 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mondo/src/mondorestore/mondo-prep.c
r2928 r2932 2488 2488 2489 2489 /** float ***********************************************************/ 2490 long longfactor;2490 float factor; 2491 2491 long long new_size; 2492 2492 … … 2523 2523 2524 2524 drivemntlist = malloc(sizeof(struct mountlist_reference)); 2525 drivemntlist->el = 2526 malloc(sizeof(struct mountlist_line *) * MAX_MOUNTLIST_ENTRIES); 2525 drivemntlist->el = malloc(sizeof(struct mountlist_line *) * MAX_MOUNTLIST_ENTRIES); 2527 2526 2528 2527 if (!drivemntlist) { … … 2538 2537 } 2539 2538 2540 if (original_size_of_drive <= 0 ) {2539 if (original_size_of_drive <= 0LL) { 2541 2540 mr_asprintf(&tmp, "Cannot resize %s's entries. Drive not found.", drive_name); 2542 2541 log_to_screen(tmp); … … 2544 2543 return; 2545 2544 } 2546 factor = ( current_size_of_drive) / (original_size_of_drive);2547 mr_asprintf(&tmp, "Disk %s was %lld MB; is now %lld MB; Proportionally resizing partitions (factor ~= % lld)",2545 factor = ((float)current_size_of_drive/(float)original_size_of_drive); 2546 mr_asprintf(&tmp, "Disk %s was %lld MB; is now %lld MB; Proportionally resizing partitions (factor ~= %.5f)", 2548 2547 drive_name, original_size_of_drive/1024, current_size_of_drive/1024, factor); 2549 2548 log_to_screen(tmp); … … 2554 2553 /* the 'atoi' thing is to make sure we don't try to resize _images_, whose formats will be numeric */ 2555 2554 if (!atoi(drivemntlist->el[partno]->format)) { 2556 new_size = ( drivemntlist->el[partno]->size) * factor;2555 new_size = (long long)((drivemntlist->el[partno]->size) * factor); 2557 2556 } else { 2558 2557 new_size = drivemntlist->el[partno]->size;
Note:
See TracChangeset
for help on using the changeset viewer.