[yast-commit] r62920 - /trunk/storage/storage/src/include/ep-lib.ycp
Author: aschnell Date: Tue Nov 30 12:12:39 2010 New Revision: 62920 URL: http://svn.opensuse.org/viewcvs/yast?rev=62920&view=rev Log: - added sanity checks (can happen when partition is outside of disk) Modified: trunk/storage/storage/src/include/ep-lib.ycp Modified: trunk/storage/storage/src/include/ep-lib.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lib.ycp?rev=62920&r1=62919&r2=62920&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-lib.ycp (original) +++ trunk/storage/storage/src/include/ep-lib.ycp Tue Nov 30 12:12:39 2010 @@ -345,9 +345,9 @@ next_cyl = Region::Start( partitions[ i+1, "region" ]:[] ); } - float tmp = (float) Region::Length(region) / (float) disk["cyl_count"]:1; - y2debug("i:%1 this cyl:%2 end cyl:%3 next cyl:%4", i, ccyl, Region::End(region), next_cyl); - AddSegment(tmp, part["name"]:"", part["size_k"]:0); + float tmp1 = (float) Region::Length(region) / (float) disk["cyl_count"]:1; + if (tmp1 >= 0.0) + AddSegment(tmp1, part["name"]:"", part["size_k"]:0); // Now there is some xtra space between the end of this partition and the start of the next one // or the end of the disk if @@ -357,7 +357,8 @@ ( (Region::End( region) + 1) != next_cyl ) ) { float tmp2 = (float) (next_cyl - Region::End(region)) / (float) disk["cyl_count"]:1; - AddSegment(tmp2, emptyspace, ((next_cyl - Region::End(region)) * disk["cyl_size"]:1) / 1024); + if (tmp2 >= 0.0) + AddSegment(tmp2, emptyspace, ((next_cyl - Region::End(region)) * disk["cyl_size"]:1) / 1024); } ccyl = next_cyl; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn2.opensuse.org