summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhelg <helg@cvs.openbsd.org>2018-07-18 10:47:03 +0000
committerhelg <helg@cvs.openbsd.org>2018-07-18 10:47:03 +0000
commit9d185f1bada9334334f6ece8016aa0a7f8be84b5 (patch)
tree6abbf48a3fe2f61001f8898010a3509b12186190
parentb552ed0877d8e0016773d99423a4548dde7685f4 (diff)
Replace VATTR_NULL() with memset(3) in fusefs_getattr(). VATTR_NULL()
sets all members of struct vattr to VNOVAL (-1) instead of 0, which is what is appropriate here. The VATTR_NULL() macro is intended for initialising struct vattr when setting attributes. ok mpi@
-rw-r--r--sys/miscfs/fuse/fuse_vnops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/miscfs/fuse/fuse_vnops.c b/sys/miscfs/fuse/fuse_vnops.c
index 3842718f91f..c28e9efe1c7 100644
--- a/sys/miscfs/fuse/fuse_vnops.c
+++ b/sys/miscfs/fuse/fuse_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_vnops.c,v 1.51 2018/07/16 16:44:09 helg Exp $ */
+/* $OpenBSD: fuse_vnops.c,v 1.52 2018/07/18 10:47:02 helg Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -400,7 +400,7 @@ fusefs_getattr(void *v)
* for the root inode in this situation.
*/
if (!fmp->allow_other && cred->cr_uid != fmp->mp->mnt_stat.f_owner) {
- VATTR_NULL(vap);
+ memset(vap, 0, sizeof(*vap));
vap->va_type = VNON;
if (vp->v_mount->mnt_flag & MNT_RDONLY)
vap->va_mode = S_IRUSR | S_IXUSR;
@@ -432,9 +432,9 @@ fusefs_getattr(void *v)
return (error);
}
- VATTR_NULL(vap);
st = &fbuf->fb_attr;
+ memset(vap, 0, sizeof(*vap));
vap->va_type = IFTOVT(st->st_mode);
vap->va_mode = st->st_mode & ~S_IFMT;
vap->va_nlink = st->st_nlink;