]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
make the log fd thread safe
authorDaniel Lezcano <daniel.lezcano@free.fr>
Tue, 21 Apr 2009 19:51:13 +0000 (21:51 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Tue, 21 Apr 2009 19:51:13 +0000 (21:51 +0200)
Add the tls attribute for the global static variables in the logs.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/log.c

index 9b7de4ff37a1885f54670f18afd2ed9ee7e75ace..d5703eb6947fd43624f5ccc9b6a396b8782a34d2 100644 (file)
@@ -16,9 +16,8 @@
 #define LXC_LOG_PREFIX_SIZE    32
 #define LXC_LOG_BUFFER_SIZE    512
 
-int lxc_log_fd = 2;
-
-static char log_prefix[LXC_LOG_PREFIX_SIZE] = "lxc";
+static __thread int lxc_log_fd = 2;
+static __thread char log_prefix[LXC_LOG_PREFIX_SIZE] = "lxc";
 
 lxc_log_define(lxc_log, lxc);