summaryrefslogtreecommitdiff
path: root/sbin/badsect/badsect.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-30 01:06:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-30 01:06:35 +0000
commite5271d427442edc0937ba76739087de6e5351c99 (patch)
tree5e279862bc5549c5b72410f64442dc4a8a7cb373 /sbin/badsect/badsect.c
parentc85c48ce5c7db7f6c194b278020cfa6c143b39cf (diff)
use raw device only; netbsd pr#2719; flipk@idea.exnet.iastate.edu
Diffstat (limited to 'sbin/badsect/badsect.c')
-rw-r--r--sbin/badsect/badsect.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sbin/badsect/badsect.c b/sbin/badsect/badsect.c
index 9a1a4773ff4..48761c025a6 100644
--- a/sbin/badsect/badsect.c
+++ b/sbin/badsect/badsect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: badsect.c,v 1.2 1996/06/23 14:29:54 deraadt Exp $ */
+/* $OpenBSD: badsect.c,v 1.3 1996/08/30 01:06:34 deraadt Exp $ */
/* $NetBSD: badsect.c,v 1.10 1995/03/18 14:54:28 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)badsect.c 8.1 (Berkeley) 6/5/93";
#else
-static char rcsid[] = "$OpenBSD: badsect.c,v 1.2 1996/06/23 14:29:54 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: badsect.c,v 1.3 1996/08/30 01:06:34 deraadt Exp $";
#endif
#endif /* not lint */
@@ -126,6 +126,14 @@ main(argc, argv)
S_ISBLK(devstat.st_mode))
break;
}
+
+ /*
+ * we've found the block device, but since the filesystem
+ * is mounted, we must write to the raw (character) device
+ * instead.
+ */
+ name[5] = 'r';
+ strcpy(&name[6], dp->d_name);
closedir(dirp);
if (dp == NULL) {
printf("Cannot find dev 0%o corresponding to %s\n",