aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-10 16:36:30 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-10 16:36:30 -0700
commit43c735d7ce8d7bcec7b2f7d7f337ea7ea7a16674 (patch)
treeaee170d38da267b938fe4edd673577cff9442726 /memdisk
parentfdfe1e9dadfa9e4b96f7c62e993f1e6548c2f293 (diff)
downloadsyslinux.git-43c735d7ce8d7bcec7b2f7d7f337ea7ea7a16674.tar.gz
syslinux.git-43c735d7ce8d7bcec7b2f7d7f337ea7ea7a16674.tar.xz
syslinux.git-43c735d7ce8d7bcec7b2f7d7f337ea7ea7a16674.zip
fdgeo.pl: exit values; fix division by zero
Return exit values to go with the error messages; don't divide by zero in case of range error.
Diffstat (limited to 'memdisk')
-rwxr-xr-xmemdisk/fdgeo.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/memdisk/fdgeo.pl b/memdisk/fdgeo.pl
index eafef761..b76727d1 100755
--- a/memdisk/fdgeo.pl
+++ b/memdisk/fdgeo.pl
@@ -33,6 +33,7 @@ if ($sec < 320*2) {
} else {
printf "%.1fK, %d sectors: ", $sec/2, $sec;
print "Considered a hard disk\n";
+ exit 2;
}
$ok = 0;
@@ -48,6 +49,8 @@ while ($c < 256) {
printf "%.1fK, %d sectors: ", $sec/2, $sec;
if ($ok) {
print "c=$c, h=$h, s=$s, type=$type\n";
+ exit 0;
} else {
print "No valid geometry found (MEMDISK will fake it)\n";
+ exit 1;
}