From owner-freebsd-alpha Tue May 2 20:40:30 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id 083C437BCDA for ; Tue, 2 May 2000 20:40:28 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (root@c04-115.006.popsite.net [216.126.137.115]) by relay.nuxi.com (8.9.3/8.9.3) with ESMTP id UAA85062 for ; Tue, 2 May 2000 20:40:23 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.9.3/8.9.1) id UAA94085 for alpha@freebsd.org; Tue, 2 May 2000 20:40:28 -0700 (PDT) (envelope-from obrien) Date: Tue, 2 May 2000 20:40:27 -0700 From: "David O'Brien" To: alpha@freebsd.org Subject: (FWD) `dd' patch pertaining to Alpha Message-ID: <20000502204027.A94062@dragon.nuxi.com> Reply-To: obrien@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-PGP-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Keyid: 34F9F9D5 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I sent Matt's patch to Brian (maintainer for `dd') and he reworked it into this. Can people comment if this fixes their `dd' problems, etc.. ----- Forwarded message from Brian Fundakowski Feldman ----- --- dd.c 1999/10/03 18:49:51 1.27 +++ dd.c 2000/05/02 05:13:21 @@ -54,2 +54,3 @@ #include +#include #include @@ -220,4 +221,10 @@ io->flags |= ISTAPE; - else if (type & (D_DISK | D_MEM)) + else if (type & (D_DISK | D_MEM)) { + if (type & D_DISK) { + const int one = 1; + + (void)ioctl(io->fd, DIOCWLABEL, &one); + } io->flags |= ISSEEK; + } if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) If the disk supports DIOCWLABEL or not, we have no way of knowing, so it makes no sense to check the error return. The error return may be EBADF for trying to set DIOCWLABEL on a non-FWRITE file descriptor, or it may be ENODEV for a device which doesn't support it, or it could be a valid error. In any case, DIOCWLABEL will make it not fail for da(4) devices, and the error return DIOCWLABEL won't matter in the end. How does that work for you? I don't have da(4) disks... Now to try to figure out what the difference between EPERM and EACCES is... These things are so annoying. -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' ----- End forwarded message ----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message