diff options
| author | christos <christos@NetBSD.org> | 2013-01-23 22:48:18 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2013-01-23 22:48:18 +0000 |
| commit | d2d7e4081ce05696e844ec3c00a6f572a7a3a9da (patch) | |
| tree | a66ad8383052ddeac7b3478554b618bcfd65c0c3 /sbin/newfs_msdos | |
| parent | b744cdcf2c0951cb1f2a99397789de40a2505d66 (diff) | |
We don't need getdiskinfo() for makefs() since we always deal with an image.
Diffstat (limited to 'sbin/newfs_msdos')
| -rw-r--r-- | sbin/newfs_msdos/mkfs_msdos.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sbin/newfs_msdos/mkfs_msdos.c b/sbin/newfs_msdos/mkfs_msdos.c index 664a4f43d10..aa1af7f4d0f 100644 --- a/sbin/newfs_msdos/mkfs_msdos.c +++ b/sbin/newfs_msdos/mkfs_msdos.c @@ -1,4 +1,4 @@ -/* $NetBSD: mkfs_msdos.c,v 1.2 2013/01/23 15:29:15 christos Exp $ */ +/* $NetBSD: mkfs_msdos.c,v 1.3 2013/01/23 22:48:18 christos 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: mkfs_msdos.c,v 1.2 2013/01/23 15:29:15 christos Exp $"); +__RCSID("$NetBSD: mkfs_msdos.c,v 1.3 2013/01/23 22:48:18 christos Exp $"); #endif #endif /* not lint */ @@ -804,12 +804,17 @@ getbpbinfo(int fd, const char *fname, const char *dtype, int iflag, maxpartitions = getmaxpartitions(); + // XXX: Does not work with wedges if (s2 && *s2 >= 'a' && *s2 <= 'a' + maxpartitions - 1) { part = *s2++ - 'a'; } if (((part != -1) && ((!iflag && part != -1) || !bpb->bsec)) || !bpb->bps || !bpb->spt || !bpb->hds) { - if (create || getdiskinfo(fname, fd, NULL, &geo, &dkw) == -1) { + if (create +#ifndef MAKEFS + || getdiskinfo(fname, fd, NULL, &geo, &dkw) == -1 +#endif + ) { struct stat st; if (fstat(fd, &st) == -1) { |
