From owner-freebsd-bugs Sat Jul 1 8:40: 7 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id B6A9537B70F for ; Sat, 1 Jul 2000 08:40:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id IAA44569; Sat, 1 Jul 2000 08:40:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Sat, 1 Jul 2000 08:40:03 -0700 (PDT) Message-Id: <200007011540.IAA44569@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: i386/19574: Let badsect recognize character device. Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR i386/19574; it has been noted by GNATS. From: Bruce Evans To: clive@CirX.ORG Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: i386/19574: Let badsect recognize character device. Date: Sun, 2 Jul 2000 01:34:19 +1000 (EST) On Thu, 29 Jun 2000 clive@CirX.ORG wrote: > >Description: > > 1) There's no block device in 5.0-C. > 2) But our sbin/badsect still look for block device. The patch leaves a lot of dead code related to block devices. > Index: badsect.c > =================================================================== > RCS file: /home/ncvs/src/sbin/badsect/badsect.c,v > retrieving revision 1.7 > diff -u -r1.7 badsect.c > --- badsect.c 1999/08/28 00:12:28 1.7 > +++ badsect.c 2000/06/29 08:39:56 > @@ -118,11 +118,17 @@ > err(3, "%s", name); > name_dir_end = name + strlen(name); > while ((dp = readdir(dirp)) != NULL) { > + /* > + * Opening of a mounted on device is not allowed. Opening it read-only is now allowed. Otherwise badsect wouldn't work at all. > + * Attempt to open the raw device instead. All disk devices are now raw. > + */ > + if (dp->d_name[0] != 'r') > + continue ; The non-'r' name should be preferred. statfs(2) should be used instead of the readdir() loop. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message