From 2c50272da5d198f4027b28f359cac2516f2e83aa Mon Sep 17 00:00:00 2001 From: "Simon L. B. Nielsen" Date: Thu, 27 Dec 2007 12:17:45 +0000 Subject: [PATCH] - Fix calculation of data slice size when NANO_DATASIZE=-1. Due to a typo, setting NANO_DATASIZE=-1 resulted in the data slice being the same size as entire image instead of the size of the remaining space on the image. - Fix detection of overcommit of the slices. This fix mainly result in a nicer error than when newfs etc. tries to write beyond the end of the disk image. MFC after: 2 weeks X-MFC after: RELENG_7 is open again --- tools/tools/nanobsd/nanobsd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index 1378861c8822..e5e609e7d956 100644 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -367,8 +367,8 @@ create_i386_diskimage ( ) ( # Data partition (if any) starts at cylinder boundary. if ($7 > 0) { print "p 4 165 " c, dsl * cs - } else if ($7 < 0 && $1 > $c) { - print "p 4 165 " c, $1 - $c + } else if ($7 < 0 && $1 > c) { + print "p 4 165 " c, $1 - c } else if ($1 < c) { print "Disk space overcommitted by", \ c - $1, "sectors" > "/dev/stderr"