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
2806a87d
Unverified
Commit
2806a87d
authored
Jun 29, 2019
by
Rachid Koucha
Committed by
GitHub
Jun 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move code/variable in smaller scope
In start.c, do not fill path[] table if not necessary Signed-off-by:
Rachid Koucha
<
rachid.koucha@gmail.com
>
parent
9752e3a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
start.c
src/lxc/start.c
+7
-6
No files found.
src/lxc/start.c
View file @
2806a87d
...
@@ -1132,7 +1132,6 @@ static int do_start(void *data)
...
@@ -1132,7 +1132,6 @@ static int do_start(void *data)
ATTR_UNUSED
__do_close_prot_errno
int
data_sock0
=
handler
->
data_sock
[
0
],
ATTR_UNUSED
__do_close_prot_errno
int
data_sock0
=
handler
->
data_sock
[
0
],
data_sock1
=
handler
->
data_sock
[
1
];
data_sock1
=
handler
->
data_sock
[
1
];
int
ret
;
int
ret
;
char
path
[
PATH_MAX
];
uid_t
new_uid
;
uid_t
new_uid
;
gid_t
new_gid
;
gid_t
new_gid
;
struct
lxc_list
*
iterator
;
struct
lxc_list
*
iterator
;
...
@@ -1239,11 +1238,6 @@ static int do_start(void *data)
...
@@ -1239,11 +1238,6 @@ static int do_start(void *data)
goto
out_warn_father
;
goto
out_warn_father
;
}
}
ret
=
snprintf
(
path
,
sizeof
(
path
),
"%s/dev/null"
,
handler
->
conf
->
rootfs
.
mount
);
if
(
ret
<
0
||
ret
>=
sizeof
(
path
))
goto
out_warn_father
;
/* In order to checkpoint restore, we need to have everything in the
/* In order to checkpoint restore, we need to have everything in the
* same mount namespace. However, some containers may not have a
* same mount namespace. However, some containers may not have a
* reasonable /dev (in particular, they may not have /dev/null), so we
* reasonable /dev (in particular, they may not have /dev/null), so we
...
@@ -1255,6 +1249,13 @@ static int do_start(void *data)
...
@@ -1255,6 +1249,13 @@ static int do_start(void *data)
* where it isn't wanted.
* where it isn't wanted.
*/
*/
if
(
handler
->
daemonize
&&
!
handler
->
conf
->
autodev
)
{
if
(
handler
->
daemonize
&&
!
handler
->
conf
->
autodev
)
{
char
path
[
PATH_MAX
];
ret
=
snprintf
(
path
,
sizeof
(
path
),
"%s/dev/null"
,
handler
->
conf
->
rootfs
.
mount
);
if
(
ret
<
0
||
ret
>=
sizeof
(
path
))
goto
out_warn_father
;
ret
=
access
(
path
,
F_OK
);
ret
=
access
(
path
,
F_OK
);
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
devnull_fd
=
open_devnull
();
devnull_fd
=
open_devnull
();
...
...
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