From: Derrick Brashear Date: Wed, 24 Feb 2010 21:02:26 +0000 (-0500) Subject: freebsd initglock endif fix X-Git-Tag: openafs-devel-1_5_73~134 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8940eb9dcf79e803449eb437d1f7076ceddba021;p=packages%2Fo%2Fopenafs.git 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 --- 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)