Changeset 2125


Ignore:
Timestamp:
Jan 14, 2009, 3:50:19 PM (11 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)
Location:
branches/2.2.8/mondo/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.8/mondo/src/common/libmondo-mountlist.c

    r2052 r2125  
    151151                res++;
    152152            }
    153             amount_allocated += mountlist->el[pos].size / 1024;
     153            amount_allocated += mountlist->el[pos].size / 1024L;
    154154            prev_sp_no = cur_sp_no;
    155155        }
     
    304304                    res++;
    305305                }
    306                 amount_allocated += mountlist->el[pos].size / 1024;
     306                amount_allocated += mountlist->el[pos].size / 1024L;
    307307                prev_sp_no = cur_sp_no;
    308308            }
     
    310310
    311311        /* OK, continue with main loop */
    312         amount_allocated += mountlist->el[pos].size / 1024;
     312        amount_allocated += mountlist->el[pos].size / 1024L;
    313313        prev_part_no = curr_part_no;
    314314    }
     
    459459        }
    460460        /* OK, continue with main loop */
    461         amount_allocated += mountlist->el[pos].size / 1024;
     461        amount_allocated += mountlist->el[pos].size / 1024L;
    462462        prev_part_no = curr_part_no;
    463463    }
  • branches/2.2.8/mondo/src/common/libmondo-string.c

    r2105 r2125  
    401401    sprintf(output, "%-24s %-24s %-10s %8lld", mountlist->el[lino].device,
    402402            mountlist->el[lino].mountpoint, mountlist->el[lino].format,
    403             mountlist->el[lino].size / 1024);
     403            mountlist->el[lino].size / 1024L);
    404404    return (output);
    405405}
  • 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
  • branches/2.2.8/mondo/src/mondorestore/mondo-rstr-newt.c

    r2094 r2125  
    241241    strcpy(mountlist->el[currline].mountpoint, mountpoint_str);
    242242    strcpy(mountlist->el[currline].format, format_str);
    243     mountlist->el[currline].size = atol(size_str) * 1024;
     243    mountlist->el[currline].size = atol(size_str) * 1024L;
    244244    mountlist->entries++;
    245245    if (strstr(mountlist->el[currline].device, RAID_DEVICE_STUB)) {
     
    11941194    strcpy(mountpt_used_to_be, mountlist->el[currline].mountpoint);
    11951195    strcpy(format_str, mountlist->el[currline].format);
    1196     sprintf(size_str, "%lld", mountlist->el[currline].size / 1024);
     1196    sprintf(size_str, "%lld", mountlist->el[currline].size / 1024L);
    11971197    newtOpenWindow(20, 5, 48, 10, "Edit entry");
    11981198    label0 = newtLabel(2, 1, "Device:");
     
    12971297                                       mountlist->el[currline].device);
    12981298        } else {
    1299             mountlist->el[currline].size = atol(size_str) * 1024;
     1299            mountlist->el[currline].size = atol(size_str) * 1024L;
    13001300        }
    13011301    }
     
    25062506        sprintf(tmp, "%-22s %8lld",
    25072507                unallocated_raid_partitions->el[i].device,
    2508                 unallocated_raid_partitions->el[i].size / 1024);
     2508                unallocated_raid_partitions->el[i].size / 1024L);
    25092509        newtListboxAppendEntry(listbox, tmp, keylist[i]);
    25102510    }
Note: See TracChangeset for help on using the changeset viewer.