diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-11-21 01:59:25 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-11-21 01:59:25 +0000 |
commit | 68dbbb7c0e8800c6b6c72bda3b1528f8e4ad6005 (patch) | |
tree | 2a3e4140910032505f16d76ef6f93e150a84a982 /sbin/fdisk/part.c | |
parent | 6a99254c76410c0c0658d8fcbe8b03c48d865d4c (diff) |
Replace default DEV_BSIZE sector conversion factor with disklabel's
sector size when possible. Fixes the "[ XX Sectors ]" size display.
Pointed out by Robert Szasz while playing with his Sony Hi-MD device.
Apply input conversion fixes similar to those recently applied to
disklabel(8). Use correct sector size in the conversions.
It is still *not* possible to use unusual sector sizes for non-ISO9660
filesystems!
ok millert@
Diffstat (limited to 'sbin/fdisk/part.c')
-rw-r--r-- | sbin/fdisk/part.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/fdisk/part.c b/sbin/fdisk/part.c index 6047aba3295..72639e97680 100644 --- a/sbin/fdisk/part.c +++ b/sbin/fdisk/part.c @@ -1,4 +1,4 @@ -/* $OpenBSD: part.c,v 1.40 2004/11/10 17:29:41 deraadt Exp $ */ +/* $OpenBSD: part.c,v 1.41 2005/11/21 01:59:24 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -283,7 +283,7 @@ PRT_print(int num, prt_t *partn, char *units) printf(" #: id C H S - C H S [ start: size ]\n"); printf("------------------------------------------------------------------------\n"); } else { - size = (double)partn->ns * DEV_BSIZE / + size = ((double)partn->ns * unit_types[SECTORS].conversion) / unit_types[i].conversion; printf("%c%1d: %.2X %4u %3u %2u - %4u %3u %2u [%12u:%12.0f%s] %s\n", (partn->flag == 0x80)?'*':' ', |