From: Jeffrey Altman Date: Thu, 14 Oct 2010 22:18:40 +0000 (-0400) Subject: Util: include assert.h in pthreads_nosig.h when required X-Git-Tag: upstream/1.8.0_pre1^2~4663 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=c494161819c6c24e36ffaac4421735f0c7ecfbc5;p=packages%2Fo%2Fopenafs.git Util: include assert.h in pthreads_nosig.h when required If assert() will be used within pthreads_nosig.h, include assert.h. Also, permit assert() to be a macro that is a no-op by always evaluating the expression. Change-Id: I8c790dcb8cb98f75028343e5de94b91ab891daad Reviewed-on: http://gerrit.openafs.org/2988 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/util/pthread_nosigs.h b/src/util/pthread_nosigs.h index f8932d2d0..1d638967e 100644 --- a/src/util/pthread_nosigs.h +++ b/src/util/pthread_nosigs.h @@ -59,6 +59,7 @@ #endif #define AFS_SIGSET_CLEAR() \ do { \ + int b; \ sigfillset(&i_tset); \ _SETSEGV \ _SETBUS \ @@ -66,12 +67,14 @@ do { \ _SETTRAP \ _SETABRT \ _SETFPE \ - assert(AFS_SET_SIGMASK(SIG_BLOCK, &i_tset, &i_oset) == 0); \ + b = (AFS_SET_SIGMASK(SIG_BLOCK, &i_tset, &i_oset) == 0); \ + assert(b); \ } while (0) #define AFS_SIGSET_RESTORE() \ do { \ - assert(AFS_SET_SIGMASK(SIG_SETMASK, &i_oset, NULL) == 0); \ + int b = (AFS_SET_SIGMASK(SIG_SETMASK, &i_oset, NULL) == 0); \ + assert(b); \ } while (0) #endif /* AFS_NT40_ENV */