Module Name: src Committed By: christos Date: Wed Jan 23 22:48:18 UTC 2013
Modified Files: src/sbin/newfs_msdos: mkfs_msdos.c Log Message: We don't need getdiskinfo() for makefs() since we always deal with an image. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/newfs_msdos/mkfs_msdos.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/newfs_msdos/mkfs_msdos.c diff -u src/sbin/newfs_msdos/mkfs_msdos.c:1.2 src/sbin/newfs_msdos/mkfs_msdos.c:1.3 --- src/sbin/newfs_msdos/mkfs_msdos.c:1.2 Wed Jan 23 10:29:15 2013 +++ src/sbin/newfs_msdos/mkfs_msdos.c Wed Jan 23 17:48:18 2013 @@ -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, co 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) {