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
66ffdb1a
Unverified
Commit
66ffdb1a
authored
Oct 28, 2016
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf/ile: avoid atoi() in config_ephemeral()
Signed-off-by:
Christian Brauner
<
christian.brauner@canonical.com
>
parent
ff6cb4ed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
conf.h
src/lxc/conf.h
+1
-1
confile.c
src/lxc/confile.c
+3
-4
No files found.
src/lxc/conf.h
View file @
66ffdb1a
...
@@ -377,7 +377,7 @@ struct lxc_conf {
...
@@ -377,7 +377,7 @@ struct lxc_conf {
gid_t
init_gid
;
gid_t
init_gid
;
/* indicator if the container will be destroyed on shutdown */
/* indicator if the container will be destroyed on shutdown */
int
ephemeral
;
unsigned
int
ephemeral
;
/* The facility to pass to syslog. Let's users establish as what type of
/* The facility to pass to syslog. Let's users establish as what type of
* program liblxc is supposed to write to the syslog. */
* program liblxc is supposed to write to the syslog. */
...
...
src/lxc/confile.c
View file @
66ffdb1a
...
@@ -2964,13 +2964,12 @@ bool network_new_hwaddrs(struct lxc_conf *conf)
...
@@ -2964,13 +2964,12 @@ bool network_new_hwaddrs(struct lxc_conf *conf)
static
int
config_ephemeral
(
const
char
*
key
,
const
char
*
value
,
static
int
config_ephemeral
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
)
struct
lxc_conf
*
lxc_conf
)
{
{
int
v
=
atoi
(
value
);
if
(
lxc_safe_uint
(
value
,
&
lxc_conf
->
ephemeral
)
<
0
)
return
-
1
;
if
(
v
!=
0
&&
v
!=
1
)
{
if
(
lxc_conf
->
ephemeral
>
1
)
{
ERROR
(
"Wrong value for lxc.ephemeral. Can only be set to 0 or 1"
);
ERROR
(
"Wrong value for lxc.ephemeral. Can only be set to 0 or 1"
);
return
-
1
;
return
-
1
;
}
else
{
lxc_conf
->
ephemeral
=
v
;
}
}
return
0
;
return
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