From 1a918ef3f755cdaaf2a24016254a609ca44415aa Mon Sep 17 00:00:00 2001 From: kstailey Date: Fri, 10 Jan 1997 19:04:08 +0000 Subject: [PATCH] use opendev(3) + man page correction --- sbin/newfs_msdos/Makefile | 4 +++- sbin/newfs_msdos/newfs_msdos.8 | 6 +++--- sbin/newfs_msdos/newfs_msdos.c | 9 ++++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/sbin/newfs_msdos/Makefile b/sbin/newfs_msdos/Makefile index 4b06e5b97fa..71af323d5ab 100644 --- a/sbin/newfs_msdos/Makefile +++ b/sbin/newfs_msdos/Makefile @@ -1,7 +1,9 @@ -# $OpenBSD: Makefile,v 1.1 1996/06/10 06:37:11 deraadt Exp $ +# $OpenBSD: Makefile,v 1.2 1997/01/10 19:04:08 kstailey Exp $ PROG= newfs_msdos MAN= newfs_msdos.8 +DPADD= ${LIBUTIL} +LDADD= -lutil ################################################################### # diff --git a/sbin/newfs_msdos/newfs_msdos.8 b/sbin/newfs_msdos/newfs_msdos.8 index 8e9af26480d..fa493dd0227 100644 --- a/sbin/newfs_msdos/newfs_msdos.8 +++ b/sbin/newfs_msdos/newfs_msdos.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: newfs_msdos.8,v 1.3 1997/01/03 16:45:38 kstailey Exp $ +.\" $OpenBSD: newfs_msdos.8,v 1.4 1997/01/10 19:04:09 kstailey Exp $ .\" .\" Copyright (c) 1995, 1996 Joerg Wunsch .\" @@ -35,7 +35,7 @@ .Nd create an MS-DOS (FAT) file system .Sh SYNOPSIS .Nm newfs_msdos -.Bq Fl f Ar capacity +.Bq Fl s Ar kilobytes .Bq Fl L Ar vollabel .Ar device .Sh DESCRIPTION @@ -55,7 +55,7 @@ won't be truncated. .Pp The options are as follows: .Bl -tag -width 10n -offset indent -.It Fl f Ar capacity +.It Fl s Ar kilobytes Use defaults for a typical file system with .Ar capacity kilobytes. Currently, the values 360, 720, 1200, and 1440 are diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c index c43c47e876f..11fc9e46874 100644 --- a/sbin/newfs_msdos/newfs_msdos.c +++ b/sbin/newfs_msdos/newfs_msdos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newfs_msdos.c,v 1.2 1996/12/04 08:33:58 deraadt Exp $ */ +/* $OpenBSD: newfs_msdos.c,v 1.3 1997/01/10 19:04:10 kstailey Exp $ */ /* * Copyright (c) 1995, 1996 Joerg Wunsch @@ -44,6 +44,7 @@ #include #include #include +#include #include "bootcode.h" #include "dosfs.h" @@ -202,6 +203,7 @@ main(argc, argv) struct tm *tp; time_t now; int c, i, fd, format = 0, rootdirsize; + char *rdev; while ((c = getopt(argc, argv, "s:L:t:")) != EOF) switch (c) { @@ -223,8 +225,13 @@ main(argc, argv) if (argc != 1) usage(); +#if 0 if ((fd = open(argv[0], O_RDWR | O_EXCL, 0)) == -1) err(1, "open(%s)", argv[0]); +#else + if ((fd = opendev(argv[0], O_RDWR | O_EXCL, OPENDEV_PART, &rdev)) < 0) + err(1, "%s", rdev); +#endif if (format == 0) { /* -- 2.20.1