]> Savannah Git Hosting - gnulib.git/commitdiff
lock tests: Avoid reference to undefined variable if !ENABLE_LOCKING.
authorBruno Haible <bruno@clisp.org>
Thu, 20 Jun 2019 01:50:52 +0000 (03:50 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 20 Jun 2019 01:50:52 +0000 (03:50 +0200)
* tests/test-lock.c (test_once): Don't reference fire_signal if
!ENABLE_LOCKING.

ChangeLog
tests/test-lock.c

index 96cbd47365c9956dc76401ac86494b8d042f260c..bd31e14af0a21150c74cc597423608b5f06f0bbe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-20  Bruno Haible  <bruno@clisp.org>
+
+       lock tests: Avoid reference to undefined variable if !ENABLE_LOCKING.
+       * tests/test-lock.c (test_once): Don't reference fire_signal if
+       !ENABLE_LOCKING.
+
 2019-06-19  Bruno Haible  <bruno@clisp.org>
 
        nanosleep: Relicense under LGPLv2+.
index 166f85b13b79e6b8bd8e8432f05f08bb2b4f658a..ca7dd62fbb0258b2e835b5f0ef0ecc6b60d15b8d 100644 (file)
@@ -647,9 +647,11 @@ test_once (void)
   fire_signal_state = 0;
 #endif
 
+#if ENABLE_LOCKING
   /* Block all fire_signals.  */
   for (i = REPEAT_COUNT-1; i >= 0; i--)
     gl_rwlock_wrlock (fire_signal[i]);
+#endif
 
   /* Spawn the threads.  */
   for (i = 0; i < THREAD_COUNT; i++)