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
934d0d8b
Unverified
Commit
934d0d8b
authored
Feb 10, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
criu: use cleanup macro
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
dc05afb2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
criu.c
src/lxc/criu.c
+4
-6
No files found.
src/lxc/criu.c
View file @
934d0d8b
...
@@ -164,11 +164,11 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
...
@@ -164,11 +164,11 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
struct
criu_opts
*
opts
)
struct
criu_opts
*
opts
)
{
{
call_cleaner
(
put_criu_exec_args
)
struct
criu_exec_args
*
args
=
NULL
;
call_cleaner
(
put_criu_exec_args
)
struct
criu_exec_args
*
args
=
NULL
;
__do_fclose
FILE
*
f_mnt
=
NULL
;
char
log
[
PATH_MAX
];
char
log
[
PATH_MAX
];
int
static_args
=
23
,
ret
;
int
static_args
=
23
,
ret
;
int
netnr
=
0
;
int
netnr
=
0
;
struct
lxc_list
*
it
;
struct
lxc_list
*
it
;
FILE
*
mnts
;
struct
mntent
mntent
;
struct
mntent
mntent
;
char
buf
[
4096
],
ttys
[
32
];
char
buf
[
4096
],
ttys
[
32
];
...
@@ -344,12 +344,12 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
...
@@ -344,12 +344,12 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
DECLARE_ARG
(
opts
->
user
->
action_script
);
DECLARE_ARG
(
opts
->
user
->
action_script
);
}
}
mnts
=
make_anonymous_mount_file
(
&
opts
->
c
->
lxc_conf
->
mount_list
,
f_mnt
=
make_anonymous_mount_file
(
&
opts
->
c
->
lxc_conf
->
mount_list
,
opts
->
c
->
lxc_conf
->
lsm_aa_allow_nesting
);
opts
->
c
->
lxc_conf
->
lsm_aa_allow_nesting
);
if
(
!
mnts
)
if
(
!
f_mnt
)
return
log_error_errno
(
-
ENOENT
,
ENOENT
,
"Failed to create anonymous mount file"
);
return
log_error_errno
(
-
ENOENT
,
ENOENT
,
"Failed to create anonymous mount file"
);
while
(
getmntent_r
(
mnts
,
&
mntent
,
buf
,
sizeof
(
buf
)))
{
while
(
getmntent_r
(
f_mnt
,
&
mntent
,
buf
,
sizeof
(
buf
)))
{
unsigned
long
flags
=
0
;
unsigned
long
flags
=
0
;
char
*
mntdata
=
NULL
;
char
*
mntdata
=
NULL
;
char
arg
[
2
*
PATH_MAX
+
2
];
char
arg
[
2
*
PATH_MAX
+
2
];
...
@@ -370,14 +370,12 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
...
@@ -370,14 +370,12 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
ret
=
snprintf
(
arg
,
sizeof
(
arg
),
"%s:%s"
,
ret
=
snprintf
(
arg
,
sizeof
(
arg
),
"%s:%s"
,
mntent
.
mnt_dir
,
mntent
.
mnt_fsname
);
mntent
.
mnt_dir
,
mntent
.
mnt_fsname
);
if
(
ret
<
0
||
ret
>=
sizeof
(
arg
))
{
if
(
ret
<
0
||
ret
>=
sizeof
(
arg
))
{
fclose
(
mnts
);
return
log_error_errno
(
-
EIO
,
EIO
,
"Failed to create mount entry"
);
return
log_error_errno
(
-
EIO
,
EIO
,
"Failed to create mount entry"
);
}
}
DECLARE_ARG
(
"--ext-mount-map"
);
DECLARE_ARG
(
"--ext-mount-map"
);
DECLARE_ARG
(
arg
);
DECLARE_ARG
(
arg
);
}
}
fclose
(
mnts
);
if
(
strcmp
(
opts
->
action
,
"dump"
)
==
0
||
strcmp
(
opts
->
action
,
"pre-dump"
)
==
0
)
{
if
(
strcmp
(
opts
->
action
,
"dump"
)
==
0
||
strcmp
(
opts
->
action
,
"pre-dump"
)
==
0
)
{
char
pid
[
32
],
*
freezer_relative
;
char
pid
[
32
],
*
freezer_relative
;
...
...
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