[cowdancer] 02/03: Don't deadlock initialization
James Clarke
jrtc27-guest at moszumanska.debian.org
Mon Sep 12 21:30:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
jrtc27-guest pushed a commit to branch master
in repository cowdancer.
commit 5160b2cd9a0522651e9436a88c68b0fa10d480ab
Author: James Clarke <jrtc27 at jrtc27.com>
Date: Mon Sep 12 22:18:37 2016 +0100
Don't deadlock initialization
---
cowdancer.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/cowdancer.c b/cowdancer.c
index 850e62b..61e5018 100644
--- a/cowdancer.c
+++ b/cowdancer.c
@@ -172,6 +172,12 @@ static int initialize_functions ()
*/
if (__builtin_expect(!initialized,0))
{
+ log_use_colors use_colors = log_get_use_colors_unresolved();
+ /* Temporarily disable auto detection, since ncurses calls fopen, which
+ * leads to initialize_functions calling itself. */
+ if (use_colors == log_use_colors_auto)
+ log_set_use_colors(log_use_colors_no);
+
initialized = 1;
origlibc_open = dlsym(RTLD_NEXT, "open");
origlibc_open64 = dlsym(RTLD_NEXT, "open64");
@@ -226,6 +232,7 @@ static int initialize_functions ()
initialized = 2;
debug_cowdancer ("Initialization successfully finished.");
}
+ log_set_use_colors(use_colors);
}
/*
Wait until somebody else finishes his job
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pbuilder/cowdancer.git
More information about the Pbuilder-maint
mailing list