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
b8d88764
Unverified
Commit
b8d88764
authored
Feb 19, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: cleanup macros lxc_chroot
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
8db92302
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
conf.c
src/lxc/conf.c
+2
-6
No files found.
src/lxc/conf.c
View file @
b8d88764
...
...
@@ -1345,10 +1345,10 @@ static int lxc_mount_rootfs(struct lxc_conf *conf)
int
lxc_chroot
(
const
struct
lxc_rootfs
*
rootfs
)
{
__do_free
char
*
nroot
=
NULL
;
int
i
,
ret
;
char
*
p
,
*
p2
;
char
buf
[
LXC_LINELEN
];
char
*
nroot
;
FILE
*
f
;
char
*
root
=
rootfs
->
mount
;
...
...
@@ -1359,10 +1359,8 @@ int lxc_chroot(const struct lxc_rootfs *rootfs)
}
ret
=
chdir
(
"/"
);
if
(
ret
<
0
)
{
free
(
nroot
);
if
(
ret
<
0
)
return
-
1
;
}
/* We could use here MS_MOVE, but in userns this mount is locked and
* can't be moved.
...
...
@@ -1370,10 +1368,8 @@ int lxc_chroot(const struct lxc_rootfs *rootfs)
ret
=
mount
(
nroot
,
"/"
,
NULL
,
MS_REC
|
MS_BIND
,
NULL
);
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to mount
\"
%s
\"
onto
\"
/
\"
as MS_REC | MS_BIND"
,
nroot
);
free
(
nroot
);
return
-
1
;
}
free
(
nroot
);
ret
=
mount
(
NULL
,
"/"
,
NULL
,
MS_REC
|
MS_PRIVATE
,
NULL
);
if
(
ret
<
0
)
{
...
...
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