summaryrefslogtreecommitdiffstats
path: root/sbin/badsect
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2000-11-09 09:03:19 +0000
committeradrian <adrian@FreeBSD.org>2000-11-09 09:03:19 +0000
commit6d404356ea8e21e3b6cefaa4a8b3bf9518e342b9 (patch)
treebead14658bff6d40fec4a6c579510629d5973eea /sbin/badsect
parent1a7266b24de5311dddd975c3c4cb4da6f15f9a45 (diff)
downloadFreeBSD-src-6d404356ea8e21e3b6cefaa4a8b3bf9518e342b9.zip
FreeBSD-src-6d404356ea8e21e3b6cefaa4a8b3bf9518e342b9.tar.gz
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
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 7ecf186..c6972b8 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;
OpenPOWER on IntegriCloud