From 9934b00e8466b567a1f526b46cc887cc1132161d Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Thu, 9 Nov 2000 09:03:19 +0000 Subject: [PATCH] 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 --- sbin/badsect/badsect.c | 8 +------- 1 file changed, 1 insertion(+), 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;