Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
2c529221
Commit
2c529221
authored
Mar 07, 2014
by
S.Çağlar Onur
Committed by
Stéphane Graber
Mar 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add shared lxc_log_fd into TLS
Signed-off-by:
S.Çağlar Onur
<
caglar@10ur.org
>
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
6485e01d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
log.c
src/lxc/log.c
+2
-1
log.h
src/lxc/log.h
+6
-0
No files found.
src/lxc/log.c
View file @
2c529221
...
@@ -40,8 +40,8 @@
...
@@ -40,8 +40,8 @@
#define LXC_LOG_PREFIX_SIZE 32
#define LXC_LOG_PREFIX_SIZE 32
#define LXC_LOG_BUFFER_SIZE 512
#define LXC_LOG_BUFFER_SIZE 512
int
lxc_log_fd
=
-
1
;
#ifdef HAVE_TLS
#ifdef HAVE_TLS
__thread
int
lxc_log_fd
=
-
1
;
static
__thread
char
log_prefix
[
LXC_LOG_PREFIX_SIZE
]
=
"lxc"
;
static
__thread
char
log_prefix
[
LXC_LOG_PREFIX_SIZE
]
=
"lxc"
;
static
__thread
char
*
log_fname
=
NULL
;
static
__thread
char
*
log_fname
=
NULL
;
/* command line values for logfile or logpriority should always override
/* command line values for logfile or logpriority should always override
...
@@ -50,6 +50,7 @@ static __thread char *log_fname = NULL;
...
@@ -50,6 +50,7 @@ static __thread char *log_fname = NULL;
static
__thread
int
lxc_logfile_specified
=
0
;
static
__thread
int
lxc_logfile_specified
=
0
;
static
__thread
int
lxc_loglevel_specified
=
0
;
static
__thread
int
lxc_loglevel_specified
=
0
;
#else
#else
int
lxc_log_fd
=
-
1
;
static
char
log_prefix
[
LXC_LOG_PREFIX_SIZE
]
=
"lxc"
;
static
char
log_prefix
[
LXC_LOG_PREFIX_SIZE
]
=
"lxc"
;
static
char
*
log_fname
=
NULL
;
static
char
*
log_fname
=
NULL
;
/* command line values for logfile or logpriority should always override
/* command line values for logfile or logpriority should always override
...
...
src/lxc/log.h
View file @
2c529221
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
#ifndef _log_h
#ifndef _log_h
#define _log_h
#define _log_h
#include "config.h"
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/time.h>
...
@@ -285,7 +287,11 @@ static inline void LXC_##PRIORITY(struct lxc_log_locinfo* locinfo, \
...
@@ -285,7 +287,11 @@ static inline void LXC_##PRIORITY(struct lxc_log_locinfo* locinfo, \
ERROR("%s - " format, strerror(errno), ##__VA_ARGS__); \
ERROR("%s - " format, strerror(errno), ##__VA_ARGS__); \
} while (0)
} while (0)
#ifdef HAVE_TLS
extern
__thread
int
lxc_log_fd
;
#else
extern
int
lxc_log_fd
;
extern
int
lxc_log_fd
;
#endif
extern
int
lxc_log_init
(
const
char
*
name
,
const
char
*
file
,
extern
int
lxc_log_init
(
const
char
*
name
,
const
char
*
file
,
const
char
*
priority
,
const
char
*
prefix
,
int
quiet
,
const
char
*
priority
,
const
char
*
prefix
,
int
quiet
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment