- Timestamp:
- Jun 24, 2010, 12:21:56 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-mountlist.c
r2516 r2665 324 324 /* OK, continue with main loop */ 325 325 amount_allocated += mountlist->el[pos].size / 1024L; 326 327 /* This should only happen at the end but not tested now */ 328 if (amount_allocated > physical_drive_size) { 329 // Used to be +1, but what if you're 1 MB too high? 330 mr_asprintf(&tmp, " %ld MB over-allocated on %s.", 331 amount_allocated - physical_drive_size, drive); 332 log_it(tmp); 333 334 /* Do we have more than 1 MB per partition ? */ 335 if (amount_allocated - physical_drive_size <= curr_part_no) { 336 /* Probably a rouding error, just passing over 337 * by reducing the last partition if possible */ 338 amount_allocated -= mountlist->el[pos].size / 1024L; 339 mountlist->el[pos].size = (mountlist->el[pos].size - curr_part_no*1024L); 340 amount_allocated += mountlist->el[pos].size / 1024L; 341 } else { 342 mr_strcat(flaws_str, "%s", tmp); 343 res++; 344 } 345 mr_free(tmp); 346 } 326 347 prev_part_no = curr_part_no; 327 348 } 328 349 329 350 /* Over-allocated the disk? Unallocated space on disk? */ 330 if (amount_allocated > physical_drive_size) // Used to be +1, but what if you're 1 MB too high? 331 { 332 mr_asprintf(&tmp, " %ld MB over-allocated on %s.", 333 amount_allocated - physical_drive_size, drive); 334 log_it(tmp); 335 mr_strcat(flaws_str, "%s", tmp); 336 mr_free(tmp); 337 res++; 338 } else if (amount_allocated < physical_drive_size - 1) { /* NOT AN ERROR, JUST A WARNING :-) */ 351 if (amount_allocated < physical_drive_size - 1) { /* NOT AN ERROR, JUST A WARNING :-) */ 339 352 mr_asprintf(&tmp, " %ld MB unallocated on %s.", 340 353 physical_drive_size - amount_allocated, drive);
Note:
See TracChangeset
for help on using the changeset viewer.