From 8940eb9dcf79e803449eb437d1f7076ceddba021 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 24 Feb 2010 16:02:26 -0500 Subject: [PATCH] freebsd initglock endif fix when initglock hit freebsd it was broken. fix it. make it obvious that such is being done Change-Id: Iac716302061be91a43f168c9a1fe56cdbbb4227d Reviewed-on: http://gerrit.openafs.org/1391 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/FBSD/osi_machdep.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/afs/FBSD/osi_machdep.h b/src/afs/FBSD/osi_machdep.h index 227c7689e..c8a6d5004 100644 --- a/src/afs/FBSD/osi_machdep.h +++ b/src/afs/FBSD/osi_machdep.h @@ -117,19 +117,20 @@ extern struct mtx afs_global_mtx; #define AFS_GLOCK() mtx_lock(&afs_global_mtx) #define AFS_GUNLOCK() mtx_unlock(&afs_global_mtx) #define ISAFS_GLOCK() (mtx_owned(&afs_global_mtx)) -#if defined(AFS_FBSD80_ENV) && defined(WITNESS) -# define osi_InitGlock() \ +# if defined(AFS_FBSD80_ENV) && defined(WITNESS) +# define osi_InitGlock() \ do { \ memset(&afs_global_mtx, 0, sizeof(struct mtx)); \ mtx_init(&afs_global_mtx, "AFS global lock", NULL, MTX_DEF); \ afs_global_owner = 0; \ } while(0) -#else -# define osi_InitGlock() \ +# else +# define osi_InitGlock() \ do { \ mtx_init(&afs_global_mtx, "AFS global lock", NULL, MTX_DEF); \ afs_global_owner = 0; \ } while (0) +# endif #else /* FBSD50 */ extern struct lock afs_global_lock; #define osi_curcred() (curproc->p_cred->pc_ucred) -- 2.39.5