From owner-cvs-all Wed Jun 28 10:48:14 2000 Delivered-To: cvs-all@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id A5A5437BF08; Wed, 28 Jun 2000 10:48:05 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e5SHlwK02694; Wed, 28 Jun 2000 10:47:58 -0700 (PDT) Date: Wed, 28 Jun 2000 10:47:58 -0700 From: Alfred Perlstein To: Chris Costello Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/miscfs/fdesc fdesc_vnops.c Message-ID: <20000628104758.Y275@fw.wintelcom.net> References: <200006272246.PAA76896@freefall.freebsd.org> <20000627223423.H20702@holly.calldei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000627223423.H20702@holly.calldei.com>; from chris@calldei.com on Tue, Jun 27, 2000 at 10:34:24PM -0500 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Chris Costello [000627 20:41] wrote: > 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. so basically change: vap->va_type = VFIFO; to: vap->va_type = VNON; and fix the long line? -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message