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
7c9a9995
Commit
7c9a9995
authored
Mar 06, 2014
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgmanager: tell dbus to do locking
Thanks to S.Çağlar for figuring out that we needed this! Also fix a memory leak found by coverity. Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
b711e4af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
cgmanager.c
src/lxc/cgmanager.c
+9
-0
No files found.
src/lxc/cgmanager.c
View file @
7c9a9995
...
...
@@ -79,6 +79,7 @@ static bool cgm_keep_connection = false;
static
struct
cgroup_ops
cgmanager_ops
;
static
int
nr_subsystems
;
static
char
**
subsystems
;
static
bool
dbus_threads_initialized
=
false
;
static
void
cgm_dbus_disconnect
(
void
)
{
...
...
@@ -95,6 +96,13 @@ static void cgm_dbus_disconnect(void)
static
bool
do_cgm_dbus_connect
(
void
)
{
DBusError
dbus_error
;
if
(
!
dbus_threads_initialized
)
{
// tell dbus to do struct locking for thread safety
dbus_threads_init_default
();
dbus_threads_initialized
=
true
;
}
dbus_error_init
(
&
dbus_error
);
connection
=
nih_dbus_connect
(
CGMANAGER_DBUS_SOCK
,
NULL
);
...
...
@@ -935,6 +943,7 @@ static bool cgm_attach(const char *name, const char *lxcpath, pid_t pid)
}
if
(
!
cgm_dbus_connect
())
{
ERROR
(
"Error connecting to cgroup manager"
);
lxc_container_put
(
c
);
return
false
;
}
// cgm_create makes sure that we have the same cgroup name for all
...
...
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