]> granicus.if.org Git - check/commitdiff
* Added ck_ prefix to mutex_lock variable
authorhugo303 <hugo303@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 11 Oct 2012 14:06:13 +0000 (14:06 +0000)
committerhugo303 <hugo303@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 11 Oct 2012 14:06:13 +0000 (14:06 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@629 64e312b2-a51f-0410-8e61-82d0ca0eb02a

NEWS
src/check_pack.c

diff --git a/NEWS b/NEWS
index d981cc8ddbef8e904af708fe00452218a94ca5f9..7d617e4fb3c4c4a079dd3a8f95135b29fdc82cdc 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 In development.
 
+* Added ck_ prefix to mutex_lock variable, to avoid name clash on Solaris.
+  Solves bug #3472574 on SF.
+
 * In autoconf, request system extensions to generate 64-bit safe code,
   solution from patch #2803433 on SF.
 
index 741e1b0fb4bc5a866cfd643f20c179c2c5dadb6e..6e630b0b92c06eb6acab48d16a8bf53d2127ba8e 100644 (file)
@@ -264,7 +264,7 @@ static void check_type (int type, const char *file, int line)
 }
 
 #ifdef HAVE_PTHREAD
-static pthread_mutex_t mutex_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t ck_mutex_lock = PTHREAD_MUTEX_INITIALIZER;
 void ppack_cleanup( void *mutex )
 {
   pthread_mutex_unlock(mutex);
@@ -282,10 +282,10 @@ void ppack (int fdes, enum ck_msg_type type, CheckMsg *msg)
   if (n > (CK_MAX_MSG_SIZE / 2))
     eprintf("Message string too long", __FILE__, __LINE__ - 2);
 
-  pthread_cleanup_push( ppack_cleanup, &mutex_lock );
-  pthread_mutex_lock(&mutex_lock);
+  pthread_cleanup_push( ppack_cleanup, &ck_mutex_lock );
+  pthread_mutex_lock(&ck_mutex_lock);
   r = write (fdes, buf, n);
-  pthread_mutex_unlock(&mutex_lock);
+  pthread_mutex_unlock(&ck_mutex_lock);
   pthread_cleanup_pop(0);
   if (r == -1)
     eprintf ("Error in call to write:", __FILE__, __LINE__ - 2);