summaryrefslogtreecommitdiff
path: root/libc/misc/syslog/syslog.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-07-02 09:05:05 +0000
committerEric Andersen <andersen@codepoet.org>2002-07-02 09:05:05 +0000
commit14867980d0cb19b05997d88611d9b50b2675363c (patch)
treecbe86f13d573e54d7f716122a5e581300e191945 /libc/misc/syslog/syslog.c
parent4a393f8643f033a3b73e66b2dd011f12fb6fb8ef (diff)
openlog could deadlock when called from vsyslog, so
allow recursive locking, -Erik
Diffstat (limited to 'libc/misc/syslog/syslog.c')
-rw-r--r--libc/misc/syslog/syslog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/misc/syslog/syslog.c b/libc/misc/syslog/syslog.c
index 6cfe714ce..79535a5ba 100644
--- a/libc/misc/syslog/syslog.c
+++ b/libc/misc/syslog/syslog.c
@@ -82,7 +82,7 @@
#ifdef __UCLIBC_HAS_THREADS__
#include <pthread.h>
-static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
# define LOCK pthread_mutex_lock(&mylock)
# define UNLOCK pthread_mutex_unlock(&mylock);
#else