Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jun 2000 22:34:24 -0500
From:      Chris Costello <chris@calldei.com>
To:        Alfred Perlstein <alfred@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/miscfs/fdesc fdesc_vnops.c
Message-ID:  <20000627223423.H20702@holly.calldei.com>
In-Reply-To: <200006272246.PAA76896@freefall.freebsd.org>
References:  <200006272246.PAA76896@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <chris@calldei.com>
|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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000627223423.H20702>