Ignore:
Timestamp:
Jan 14, 2009, 3:50:19 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Changes the way to compute original_size_of_drive in mondo-prep.c to correspond to the way it's done in libmondo-mountlist.c, and thus avoiding aborting nuje mode for 2 MB (which could come from adjustements in computation)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.8/mondo/src/mondorestore/mondo-prep.c

    r2087 r2125  
    24572457
    24582458    /** long *************************************************************/
    2459     long newsizL;
     2459    long newsizL = 0L;
    24602460    long current_size_of_drive = 0L;
    24612461    long original_size_of_drive = 0L;
    2462     long final_size;            /* all in Megabytes */
     2462    long final_size = 0L;           /* all in Megabytes */
    24632463    struct mountlist_reference *drivemntlist;
    24642464
     
    24792479    }
    24802480
    2481     /*
    2482        sprintf (tmp, "cp -f %s %s.pre-resize", g_mountlist_fname, g_mountlist_fname);
    2483        run_program_and_log_output (tmp, FALSE);
    2484      */
    2485 
    24862481    current_size_of_drive = get_phys_size_of_drive(drive_name);
    24872482
     
    25052500
    25062501    for (partno = 0; partno < drivemntlist->entries; partno++) {
    2507         original_size_of_drive += drivemntlist->el[partno]->size;
    2508     }
    2509     original_size_of_drive = original_size_of_drive / 1024;
     2502        if (drivemntlist->el[partno]->size > 0) {
     2503            original_size_of_drive += (drivemntlist->el[partno]->size / 1024L);
     2504        }
     2505    }
    25102506
    25112507    if (original_size_of_drive <= 0) {
     
    25402536            newsizL = (long) new_size;
    25412537        }
     2538
     2539        /* Do not apply the factor if partition was of negative size */
     2540        if (newsizL < 0) {
     2541            newsizL = drivemntlist->el[partno]->size;
     2542        }
     2543
    25422544        sprintf(tmp, "Changing %s from %lld KB to %ld KB",
    25432545                drivemntlist->el[partno]->device,
     
    25482550    final_size = get_phys_size_of_drive(drive_name);
    25492551    sprintf(tmp, "final_size = %ld MB", final_size);
     2552    log_to_screen(tmp);
    25502553    paranoid_free(tmp);
    2551     log_to_screen(tmp);
    25522554}
    25532555
Note: See TracChangeset for help on using the changeset viewer.