]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Do not use pthread.h API without header
authorBrad King <brad.king@kitware.com>
Mon, 26 Oct 2015 14:13:24 +0000 (10:13 -0400)
committerBrad King <brad.king@kitware.com>
Mon, 26 Oct 2015 14:20:50 +0000 (10:20 -0400)
libarchive/archive_random.c

index f4d42547f69e0eb240e4ad5800f251f2f16e4530..a20b9b111510e87625ea4c9b73ad1f34f5ca51dd 100644 (file)
@@ -142,11 +142,10 @@ struct arc4_stream {
        uint8_t s[256];
 };
 
-static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
-
 #define        RANDOMDEV       "/dev/urandom"
 #define        KEYSIZE         128
 #ifdef HAVE_PTHREAD_H
+static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
 #define        _ARC4_LOCK()    pthread_mutex_lock(&arc4random_mtx);
 #define        _ARC4_UNLOCK()  pthread_mutex_unlock(&arc4random_mtx);
 #else