From 930d1a1b9878a437cfea0eee5b30f96c922e4fa9 Mon Sep 17 00:00:00 2001 From: millert Date: Sun, 21 Sep 1997 00:30:11 +0000 Subject: Make "fdformat fd0" work. --- usr.sbin/fdformat/fdformat.1 | 8 ++------ usr.sbin/fdformat/fdformat.c | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'usr.sbin/fdformat') diff --git a/usr.sbin/fdformat/fdformat.1 b/usr.sbin/fdformat/fdformat.1 index a37319c196a..798ab72edd5 100644 --- a/usr.sbin/fdformat/fdformat.1 +++ b/usr.sbin/fdformat/fdformat.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: fdformat.1,v 1.3 1997/09/21 00:10:43 millert Exp $ +.\" $OpenBSD: fdformat.1,v 1.4 1997/09/21 00:30:11 millert Exp $ .\" .\" Copyright (C) 1993, 1994 by Joerg Wunsch, Dresden .\" All rights reserved. @@ -55,11 +55,7 @@ should be a character device; it may be given either with a full path name of a raw device node for a floppy disk drive .Pq e.\ g. Pa /dev/rfd0c , or default name in an abbreviated form -.Pq e.\ g. Em fd0c . -In the latter case, the name is constructed by prepending -.Pa /dev/r -to the -.Ar device_name . +.Pq e.\ g. Em fd0 . Note that any geometry constraints of the device node .Pq minor device number are meaningless, since they're overridden by diff --git a/usr.sbin/fdformat/fdformat.c b/usr.sbin/fdformat/fdformat.c index 121773d9b18..947add827bb 100644 --- a/usr.sbin/fdformat/fdformat.c +++ b/usr.sbin/fdformat/fdformat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdformat.c,v 1.4 1997/08/18 03:11:30 millert Exp $ */ +/* $OpenBSD: fdformat.c,v 1.5 1997/09/21 00:30:11 millert Exp $ */ /* * Copyright (C) 1992-1994 by Joerg Wunsch, Dresden @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -244,8 +245,7 @@ main(argc, argv) if(optind != argc - 1) usage(); - fd = opendev(argv[optind], O_RDWR, 0, &devname); - if (fd < 0) + if ((fd = opendev(argv[optind], O_RDWR, OPENDEV_PART, &devname)) < 0) err(1, devname); if(ioctl(fd, FD_GTYPE, &fdt) < 0) -- cgit v1.2.3-59-g8ed1b