From: Daniel Lezcano Date: Tue, 21 Apr 2009 19:51:13 +0000 (+0200) Subject: make the log fd thread safe X-Git-Tag: lxc_0_6_2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c9bd0073f29573181dc16a840c674dacc8a33fd;p=thirdparty%2Flxc.git make the log fd thread safe Add the tls attribute for the global static variables in the logs. Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/log.c b/src/lxc/log.c index 9b7de4ff3..d5703eb69 100644 --- a/src/lxc/log.c +++ b/src/lxc/log.c @@ -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);