From 726bd7bebfa973757f7e9d5a7e291d6ba55247af Mon Sep 17 00:00:00 2001 From: Chris Costello Date: Wed, 28 Jun 2000 19:18:25 +0000 Subject: [PATCH] fdesc_getattr: Don't fake any file types, just set vap->va_type to IFTOVT(stb.st_mode). If something does not report its mode, vap->va_type is set to VNON accordingly. --- sys/fs/fdescfs/fdesc_vnops.c | 8 ++------ sys/miscfs/fdesc/fdesc_vnops.c | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index e0b61f70193..772a94ca377 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -330,15 +330,11 @@ fdesc_getattr(ap) break; default: + bzero(&stb, sizeof(stb)); error = fo_stat(fp, &stb, ap->a_p); if (error == 0) { VATTR_NULL(vap); - /* XXX Fake it! */ - if (fp->f_type != DTYPE_PIPE && fp->f_type != DTYPE_SOCKET) - vap->va_type = VFIFO; - else - vap->va_type = IFTOVT(stb.st_mode); - + vap->va_type = IFTOVT(stb.st_mode); vap->va_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; vap->va_nlink = 1; diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c index e0b61f70193..772a94ca377 100644 --- a/sys/miscfs/fdesc/fdesc_vnops.c +++ b/sys/miscfs/fdesc/fdesc_vnops.c @@ -330,15 +330,11 @@ fdesc_getattr(ap) break; default: + bzero(&stb, sizeof(stb)); error = fo_stat(fp, &stb, ap->a_p); if (error == 0) { VATTR_NULL(vap); - /* XXX Fake it! */ - if (fp->f_type != DTYPE_PIPE && fp->f_type != DTYPE_SOCKET) - vap->va_type = VFIFO; - else - vap->va_type = IFTOVT(stb.st_mode); - + vap->va_type = IFTOVT(stb.st_mode); vap->va_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; vap->va_nlink = 1;