aboutsummaryrefslogtreecommitdiff
path: root/sbin/badsect
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2000-11-09 09:03:19 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2000-11-09 09:03:19 +0000
commit9934b00e8466b567a1f526b46cc887cc1132161d (patch)
tree7de814443f724599300bd16f6959a21a5a323805 /sbin/badsect
parent806d7daafe9953ef3f37c1ced4f10e9fb7ec6f31 (diff)
downloadsrc-9934b00e8466b567a1f526b46cc887cc1132161d.tar.gz
src-9934b00e8466b567a1f526b46cc887cc1132161d.zip
Remove the block/char device distinction. badsect only worked on bdevs,
and then mapped /dev/foo into /dev/rfoo to get to the character device. This isn't needed anymore. Reviewed by: ps
Notes
Notes: svn path=/head/; revision=68521
Diffstat (limited to 'sbin/badsect')
-rw-r--r--sbin/badsect/badsect.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sbin/badsect/badsect.c b/sbin/badsect/badsect.c
index 7ecf1863735d..c6972b859ee8 100644
--- a/sbin/badsect/badsect.c
+++ b/sbin/badsect/badsect.c
@@ -122,7 +122,7 @@ main(argc, argv)
if (lstat(name, &devstat) < 0)
err(4, "%s", name);
if (stbuf.st_dev == devstat.st_rdev &&
- (devstat.st_mode & IFMT) == IFBLK)
+ (devstat.st_mode & IFMT) == IFCHR)
break;
}
closedir(dirp);
@@ -131,12 +131,6 @@ main(argc, argv)
(u_long)stbuf.st_rdev, argv[1]);
exit(5);
}
- /*
- * Opening of a mounted on device is not allowed.
- * Attempt to open the raw device instead.
- */
- memcpy(name_dir_end + 1, name_dir_end, strlen(name_dir_end) + 1);
- *name_dir_end = 'r';
if ((fsi = open(name, O_RDONLY)) < 0)
err(6, "%s", name);
fs = &sblock;