summaryrefslogtreecommitdiff
path: root/sbin/newfs_msdos
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2009-01-18 10:50:56 +0000
committermrg <mrg@NetBSD.org>2009-01-18 10:50:56 +0000
commit5be383f77e7ee6e5ae32ab4e102a23ef88c87e28 (patch)
tree52620d69d20355410f7d1d40cd9e811e14e36a68 /sbin/newfs_msdos
parent94a79c95d53f94afc7503eb06109060758c42911 (diff)
Do not erroneously leave a truncated 16-bit sector
count on "large" (>=32MB) file systems when fetching the geometry from the medium. This confuses some software (which is to say Windows) when a device newfs(8)ed under NetBSD is transported to another system. (Note: The rest of the code uses 'bsec', and DTRT for smaller file systems.) contributed anonymously.
Diffstat (limited to 'sbin/newfs_msdos')
-rw-r--r--sbin/newfs_msdos/newfs_msdos.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c
index 0c722fb24fe..b0f775bad33 100644
--- a/sbin/newfs_msdos/newfs_msdos.c
+++ b/sbin/newfs_msdos/newfs_msdos.c
@@ -1,4 +1,4 @@
-/* $NetBSD: newfs_msdos.c,v 1.28 2008/12/26 04:23:17 jmcneill Exp $ */
+/* $NetBSD: newfs_msdos.c,v 1.29 2009/01/18 10:50:56 mrg Exp $ */
/*
* Copyright (c) 1998 Robert Nordier
@@ -33,7 +33,7 @@
static const char rcsid[] =
"$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
#else
-__RCSID("$NetBSD: newfs_msdos.c,v 1.28 2008/12/26 04:23:17 jmcneill Exp $");
+__RCSID("$NetBSD: newfs_msdos.c,v 1.29 2009/01/18 10:50:56 mrg Exp $");
#endif
#endif /* not lint */
@@ -799,10 +799,8 @@ getbpbinfo(int fd, const char *fname, const char *dtype, int oflag,
bpb->spt = ckgeom(fname, geo.dg_nsectors, "sectors/track");
if (!bpb->hds)
bpb->hds = ckgeom(fname, geo.dg_ntracks, "drive heads");
- if (!bpb->sec)
- bpb->sec = geo.dg_secperunit;
if (!bpb->bsec)
- bpb->bsec = bpb->sec;
+ bpb->bsec = geo.dg_secperunit;
}
}