summaryrefslogtreecommitdiffstats
path: root/sys/miscfs
diff options
context:
space:
mode:
authorchris <chris@FreeBSD.org>2000-06-28 19:18:25 +0000
committerchris <chris@FreeBSD.org>2000-06-28 19:18:25 +0000
commit6e95d4a6c3b208d92c4ef27b32abe76b831cf023 (patch)
tree90fa3a16794cc09d3e1c7e1118ea4e320d70157c /sys/miscfs
parentea6c5e61ca4e0e1c74432e55fe3ddbc1f4b620ae (diff)
downloadFreeBSD-src-6e95d4a6c3b208d92c4ef27b32abe76b831cf023.zip
FreeBSD-src-6e95d4a6c3b208d92c4ef27b32abe76b831cf023.tar.gz
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.
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/fdesc/fdesc_vnops.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c
index e0b61f7..772a94c 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;
OpenPOWER on IntegriCloud