Changeset 2037 in MondoRescue for branches/2.2.7/mondo/src
- Timestamp:
- Oct 7, 2008, 12:12:01 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.7/mondo/src/mondorestore/mondo-prep.c
r2035 r2037 2563 2563 2564 2564 /** 2565 * Calculate the probable size of @p drive_name by adding up sizes in2566 * @p mountlist.2567 * @param mountlist The mountlist to use to calculate the size.2568 * @param drive_name The drive to calculate the original size of.2569 * @return The size of @p drive_name in kilobytes.2570 */2571 long calc_orig_size_of_drive_from_mountlist(struct mountlist_itself2572 *mountlist, char *drive_name)2573 {2574 /** long ************************************************************/2575 long original_size_of_drive;2576 2577 /** int *************************************************************/2578 int partno;2579 2580 /** buffers *********************************************************/2581 char *tmp;2582 2583 /** end *************************************************************/2584 2585 malloc_string(tmp);2586 assert(mountlist != NULL);2587 assert_string_is_neither_NULL_nor_zerolength(drive_name);2588 2589 for (original_size_of_drive = 0, partno = 0;2590 partno < mountlist->entries; partno++) {2591 if (strncmp2592 (mountlist->el[partno].device, drive_name,2593 strlen(drive_name)) == 0) {2594 original_size_of_drive += mountlist->el[partno].size;2595 } else {2596 sprintf(tmp, "Skipping %s", mountlist->el[partno].device);2597 // log_to_screen(tmp);2598 }2599 }2600 original_size_of_drive = original_size_of_drive / 1024;2601 paranoid_free(tmp);2602 return (original_size_of_drive);2603 }2604 2605 2606 /**2607 2565 * Resize a drive's entries in @p mountlist proportionately to fit its new size. 2608 2566 * There are a few problems with this function: … … 2633 2591 /** long *************************************************************/ 2634 2592 long newsizL; 2635 long current_size_of_drive = 0 ;2636 long original_size_of_drive = 0 ;2593 long current_size_of_drive = 0L; 2594 long original_size_of_drive = 0L; 2637 2595 long final_size; /* all in Megabytes */ 2638 2596 struct mountlist_reference *drivemntlist;
Note:
See TracChangeset
for help on using the changeset viewer.