From owner-cvs-all Tue Jun 27 20:39:52 2000 Delivered-To: cvs-all@freebsd.org Received: from mta4.rcsntx.swbell.net (mta4.rcsntx.swbell.net [151.164.30.28]) by hub.freebsd.org (Postfix) with ESMTP id 9838F37BF55; Tue, 27 Jun 2000 20:39:47 -0700 (PDT) (envelope-from chris@holly.calldei.com) Received: from holly.calldei.com ([208.191.149.190]) by mta4.rcsntx.swbell.net (Sun Internet Mail Server sims.3.5.2000.01.05.12.18.p9) with ESMTP id <0FWU00HLWI0YYQ@mta4.rcsntx.swbell.net>; Tue, 27 Jun 2000 22:36:40 -0500 (CDT) Received: (from chris@localhost) by holly.calldei.com (8.9.3/8.9.3) id WAA57000; Tue, 27 Jun 2000 22:34:25 -0500 (CDT envelope-from chris) Date: Tue, 27 Jun 2000 22:34:24 -0500 From: Chris Costello Subject: Re: cvs commit: src/sys/miscfs/fdesc fdesc_vnops.c In-reply-to: <200006272246.PAA76896@freefall.freebsd.org> To: Alfred Perlstein Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Reply-To: chris@calldei.com Message-id: <20000627223423.H20702@holly.calldei.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii User-Agent: Mutt/0.96.4i References: <200006272246.PAA76896@freefall.freebsd.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tuesday, June 27, 2000, Alfred Perlstein wrote: > alfred 2000/06/27 15:46:36 PDT > > Modified files: > sys/miscfs/fdesc fdesc_vnops.c > Log: > by changing the logic here we can support dynamic additions of new > filetypes. + + default: error = fo_stat(fp, &stb, ap->a_p); if (error == 0) { VATTR_NULL(vap); - if (fp->f_type == DTYPE_KQUEUE) + /* XXX Fake it! */ + if (fp->f_type != DTYPE_PIPE && fp->f_type != DTYPE_SOCKET) vap->va_type = VFIFO; This has bad style (way past 80 columns) and it just does not make sense. This doesn't make it any easier to add new file types, and you're just hiding the DTYPE_KQUEUE, DTYPE_PIPE and DTYPE_SOCKET cases inside a default: handler. Are all new file types going to be FIFOs? What you should really do is ensure that any new file type returns proper stat information. I'm tempted to say that ones that don't should be treated as VNON, rather than VFIFO, from a design perspective. -- |Chris Costello |Is reading in the bathroom considered Multi-Tasking? `---------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message