foosize()'s return value is in DEV_BSIZE units; adjust the size obtained
from the disklabel accordingly.
This commit is contained in:
parent
84166e5151
commit
45097cab83
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wd.c,v 1.14 1997/06/18 20:43:49 pk Exp $ */
|
||||
/* $NetBSD: wd.c,v 1.15 1997/06/24 00:38:46 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
|
||||
|
@ -1548,7 +1548,8 @@ wdsize(dev)
|
|||
if (wd->sc_dk.dk_label->d_partitions[part].p_fstype != FS_SWAP)
|
||||
size = -1;
|
||||
else
|
||||
size = wd->sc_dk.dk_label->d_partitions[part].p_size;
|
||||
size = wd->sc_dk.dk_label->d_partitions[part].p_size *
|
||||
(wd->sc_dk.dk_label->d_secsize / DEV_BSIZE);
|
||||
if (omask == 0 && wdclose(dev, 0, S_IFBLK, NULL) != 0)
|
||||
return (-1);
|
||||
return (size);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wd.c,v 1.14 1997/06/18 20:43:49 pk Exp $ */
|
||||
/* $NetBSD: wd.c,v 1.15 1997/06/24 00:38:46 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
|
||||
|
@ -1548,7 +1548,8 @@ wdsize(dev)
|
|||
if (wd->sc_dk.dk_label->d_partitions[part].p_fstype != FS_SWAP)
|
||||
size = -1;
|
||||
else
|
||||
size = wd->sc_dk.dk_label->d_partitions[part].p_size;
|
||||
size = wd->sc_dk.dk_label->d_partitions[part].p_size *
|
||||
(wd->sc_dk.dk_label->d_secsize / DEV_BSIZE);
|
||||
if (omask == 0 && wdclose(dev, 0, S_IFBLK, NULL) != 0)
|
||||
return (-1);
|
||||
return (size);
|
||||
|
|
Loading…
Reference in New Issue