From 9ff6e783b1303af5b0c829e0acac318f7dd18bf5 Mon Sep 17 00:00:00 2001 From: helg Date: Wed, 18 Jul 2018 10:47:02 +0000 Subject: [PATCH] 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@ --- sys/miscfs/fuse/fuse_vnops.c | 6 +++--- 1 file 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 * @@ -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; -- 2.20.1