diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-09-26 01:49:19 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-09-26 01:49:19 +0000 |
commit | 66d91b53470a9a3eddf6c806d93e212d9c7174f5 (patch) | |
tree | b3ed3859d281abf4f1248b6d155148b7b90a6101 | |
parent | 933d3184b48f37a58ba238b3901e32389c1b33f7 (diff) |
No longer allow the "newfs -flags /dev/rdev disk-type" form. It's
no longer documented and disk type is settable via the -T flag.
Also fix a problem kept newfs from building w/o COMPAT being defined.
-rw-r--r-- | sbin/newfs/newfs.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 88ae0220bee..d2b692d3664 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newfs.c,v 1.16 1997/07/25 19:13:07 mickey Exp $ */ +/* $OpenBSD: newfs.c,v 1.17 1997/09/26 01:49:18 millert Exp $ */ /* $NetBSD: newfs.c,v 1.20 1996/05/16 07:13:03 thorpej Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)newfs.c 8.8 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: newfs.c,v 1.16 1997/07/25 19:13:07 mickey Exp $"; +static char rcsid[] = "$OpenBSD: newfs.c,v 1.17 1997/09/26 01:49:18 millert Exp $"; #endif #endif /* not lint */ @@ -336,7 +336,7 @@ main(argc, argv) argc -= optind; argv += optind; - if (ffs && argc != 2 && (mfs || argc != 1)) + if (ffs && argc - mfs != 1) usage(); special = argv[0]; @@ -424,12 +424,15 @@ main(argc, argv) ++mp; } } +#ifdef COMPAT if (mfs && disktype != NULL) { lp = (struct disklabel *)getdiskbyname(disktype); if (lp == NULL) fatal("%s: unknown disk type", disktype); pp = &lp->d_partitions[1]; - } else { + } else +#endif + { fsi = open(special, O_RDONLY); if (fsi < 0) fatal("%s: %s", special, strerror(errno)); @@ -443,10 +446,6 @@ main(argc, argv) && !isdigit(*cp)) fatal("%s: can't figure out file system partition", argv[0]); -#ifdef COMPAT - if (!mfs && disktype == NULL) - disktype = argv[1]; -#endif lp = getdisklabel(special, fsi); if (isdigit(*cp)) pp = &lp->d_partitions[0]; @@ -712,15 +711,10 @@ usage() fprintf(stderr, "usage: %s [ -fsoptions ] special-device mount-point\n", __progname); - } else + } else { fprintf(stderr, - "usage: %s [ -fsoptions ] special-device%s\n", - __progname, -#ifdef COMPAT - " [device-type]"); -#else - ""); -#endif + "usage: %s [ -fsoptions ] special-device\n", __progname); + } fprintf(stderr, "where fsoptions are:\n"); fprintf(stderr, "\t-N do not create file system, just print out parameters\n"); |