From c494161819c6c24e36ffaac4421735f0c7ecfbc5 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 14 Oct 2010 18:18:40 -0400 Subject: [PATCH 1/1] 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 --- src/util/pthread_nosigs.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/util/pthread_nosigs.h b/src/util/pthread_nosigs.h index f8932d2..1d63896 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 */ -- 1.9.4