From owner-freebsd-commit Sun Apr 2 09:38:07 1995 Return-Path: commit-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id JAA03758 for commit-outgoing; Sun, 2 Apr 1995 09:38:07 -0700 Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id JAA03744 for cvs-sbin-outgoing; Sun, 2 Apr 1995 09:38:04 -0700 Received: (from bde@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id JAA03684; Sun, 2 Apr 1995 09:36:40 -0700 Date: Sun, 2 Apr 1995 09:36:40 -0700 From: Bruce Evans Message-Id: <199504021636.JAA03684@freefall.cdrom.com> To: CVS-commiters, cvs-sbin Subject: cvs commit: src/sbin/badsect badsect.c Sender: commit-owner@FreeBSD.org Precedence: bulk bde 95/04/02 09:36:39 Modified: sbin/badsect badsect.c Log: Make this actually work. It always failed in FreeBSD because it attempted to open the mounted block device containing the directory to put the bad sector files in, and opening of mounted block devices hasn't been allowed since Net/2 or before. Attempt to open the raw device instead. Be more careful about long names. Use lstat() instead of stat() to search for block devices so that my symlink to the default floppy doesn't cause problems. Check for truncation of the block number when it is squeezed through the mknod() interface. The maximum used to be only 32767, but now it large enough.