From owner-freebsd-arch Mon Jan 14 13:19:43 2002 Delivered-To: freebsd-arch@freebsd.org Received: from iclub.nsu.ru (iclub.nsu.ru [193.124.222.66]) by hub.freebsd.org (Postfix) with ESMTP id 5E1E137B402 for ; Mon, 14 Jan 2002 13:19:18 -0800 (PST) Received: (from fjoe@localhost) by iclub.nsu.ru (8.11.6/8.11.6) id g0ELJ2899346 for arch@freebsd.org; Tue, 15 Jan 2002 03:19:02 +0600 (NS) (envelope-from fjoe) Date: Tue, 15 Jan 2002 03:19:01 +0600 From: Max Khon To: arch@freebsd.org Subject: request for review Message-ID: <20020115031901.A99067@iclub.nsu.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline hi, there! please review attached patch. it should fix `diff' when one of the compared files is a tty (e.g. 'diff -u - /etc/motd'). The problem is that fstat(0, &s) returns s.st_blocksize == 0 in this case and this breaks `diff'. I do not know if this is correct fix (should `diff' be fixed instead?) but under OpenBSD 2.9 and Linux 2.2.x non-zero values are returned. /fjoe --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="vfs_vnops.c.diff" ? current-diffs Index: vfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_vnops.c,v retrieving revision 1.125 diff -u -p -r1.125 vfs_vnops.c --- vfs_vnops.c 18 Dec 2001 20:48:54 -0000 1.125 +++ vfs_vnops.c 14 Jan 2002 18:04:45 -0000 @@ -579,6 +579,8 @@ vn_stat(vp, sb, td) sb->st_blksize = vp->v_rdev->si_bsize_phys; if (sb->st_blksize < BLKDEV_IOSIZE) sb->st_blksize = BLKDEV_IOSIZE; + } else if (vap->va_type == VCHR) { + sb->st_blksize = vap->va_blocksize; } else { sb->st_blksize = 0; } --qDbXVdCdHGoSgWSk-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message