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
c6f6b380
Unverified
Commit
c6f6b380
authored
Dec 09, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity: #1425862
initialize handler Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d9f8e1b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
criu.c
src/lxc/criu.c
+2
-0
start.c
src/lxc/start.c
+25
-0
start.h
src/lxc/start.h
+1
-0
No files found.
src/lxc/criu.c
View file @
c6f6b380
...
...
@@ -1147,6 +1147,8 @@ static bool do_dump(struct lxc_container *c, char *mode, struct migrate_opts *op
close
(
criuout
[
0
]);
lxc_zero_handler
(
&
h
);
h
.
name
=
c
->
name
;
if
(
!
cgroup_init
(
&
h
))
{
ERROR
(
"failed to cgroup_init()"
);
...
...
src/lxc/start.c
View file @
c6f6b380
...
...
@@ -509,6 +509,31 @@ out_sigfd:
return
-
1
;
}
void
lxc_zero_handler
(
struct
lxc_handler
*
handler
)
{
int
i
;
memset
(
handler
,
0
,
sizeof
(
struct
lxc_handler
));
handler
->
clone_flags
=
-
1
;
handler
->
pinfd
=
-
1
;
handler
->
sigfd
=
-
1
;
for
(
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
handler
->
nsfd
[
i
]
=
-
1
;
handler
->
data_sock
[
0
]
=
-
1
;
handler
->
data_sock
[
1
]
=
-
1
;
handler
->
state_socket_pair
[
0
]
=
-
1
;
handler
->
state_socket_pair
[
1
]
=
-
1
;
handler
->
sync_sock
[
0
]
=
-
1
;
handler
->
sync_sock
[
1
]
=
-
1
;
}
void
lxc_free_handler
(
struct
lxc_handler
*
handler
)
{
if
(
handler
->
conf
&&
handler
->
conf
->
maincmd_fd
)
...
...
src/lxc/start.h
View file @
c6f6b380
...
...
@@ -125,6 +125,7 @@ extern struct lxc_handler *lxc_init_handler(const char *name,
struct
lxc_conf
*
conf
,
const
char
*
lxcpath
,
bool
daemonize
);
extern
void
lxc_zero_handler
(
struct
lxc_handler
*
handler
);
extern
void
lxc_free_handler
(
struct
lxc_handler
*
handler
);
extern
int
lxc_init
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
void
lxc_fini
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
...
...
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