diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-06-10 16:36:30 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-06-10 16:36:30 -0700 |
commit | 43c735d7ce8d7bcec7b2f7d7f337ea7ea7a16674 (patch) | |
tree | aee170d38da267b938fe4edd673577cff9442726 | |
parent | fdfe1e9dadfa9e4b96f7c62e993f1e6548c2f293 (diff) | |
download | syslinux-43c735d7ce8d7bcec7b2f7d7f337ea7ea7a16674.tar.gz |
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.
-rwxr-xr-x | memdisk/fdgeo.pl | 3 |
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; } |