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
e2eae703
Commit
e2eae703
authored
Mar 13, 2018
by
Felix Abecassis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: fix usage of boolean function set_config_item
Signed-off-by:
Felix Abecassis
<
fabecassis@nvidia.com
>
parent
93936fbc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
lxc_execute.c
src/lxc/tools/lxc_execute.c
+6
-6
lxc_start.c
src/lxc/tools/lxc_start.c
+1
-1
tool_utils.c
src/lxc/tools/tool_utils.c
+5
-5
tool_utils.h
src/lxc/tools/tool_utils.h
+2
-2
No files found.
src/lxc/tools/lxc_execute.c
View file @
e2eae703
...
...
@@ -194,8 +194,8 @@ int main(int argc, char *argv[])
}
}
ret
=
lxc_config_define_load
(
&
defines
,
c
);
if
(
ret
)
{
b
ret
=
lxc_config_define_load
(
&
defines
,
c
);
if
(
!
b
ret
)
{
lxc_container_put
(
c
);
exit
(
EXIT_FAILURE
);
}
...
...
@@ -209,8 +209,8 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
}
ret
=
c
->
set_config_item
(
c
,
"lxc.init.uid"
,
buf
);
if
(
ret
<
0
)
{
b
ret
=
c
->
set_config_item
(
c
,
"lxc.init.uid"
,
buf
);
if
(
!
bret
)
{
lxc_container_put
(
c
);
exit
(
EXIT_FAILURE
);
}
...
...
@@ -225,8 +225,8 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
}
ret
=
c
->
set_config_item
(
c
,
"lxc.init.gid"
,
buf
);
if
(
ret
<
0
)
{
b
ret
=
c
->
set_config_item
(
c
,
"lxc.init.gid"
,
buf
);
if
(
!
bret
)
{
lxc_container_put
(
c
);
exit
(
EXIT_FAILURE
);
}
...
...
src/lxc/tools/lxc_start.c
View file @
e2eae703
...
...
@@ -277,7 +277,7 @@ int main(int argc, char *argv[])
goto
out
;
}
if
(
lxc_config_define_load
(
&
defines
,
c
))
if
(
!
lxc_config_define_load
(
&
defines
,
c
))
goto
out
;
if
(
!
rcfile
&&
!
strcmp
(
"/sbin/init"
,
args
[
0
]))
{
...
...
src/lxc/tools/tool_utils.c
View file @
e2eae703
...
...
@@ -800,20 +800,20 @@ int lxc_config_define_add(struct lxc_list *defines, char *arg)
return
0
;
}
int
lxc_config_define_load
(
struct
lxc_list
*
defines
,
struct
lxc_container
*
c
)
bool
lxc_config_define_load
(
struct
lxc_list
*
defines
,
struct
lxc_container
*
c
)
{
struct
lxc_list
*
it
;
int
ret
=
0
;
bool
bret
=
true
;
lxc_list_for_each
(
it
,
defines
)
{
struct
new_config_item
*
new_item
=
it
->
elem
;
ret
=
c
->
set_config_item
(
c
,
new_item
->
key
,
new_item
->
val
);
if
(
ret
<
0
)
b
ret
=
c
->
set_config_item
(
c
,
new_item
->
key
,
new_item
->
val
);
if
(
!
bret
)
break
;
}
lxc_config_define_free
(
defines
);
return
ret
;
return
b
ret
;
}
void
lxc_config_define_free
(
struct
lxc_list
*
defines
)
...
...
src/lxc/tools/tool_utils.h
View file @
e2eae703
...
...
@@ -160,8 +160,8 @@ extern char *get_template_path(const char *t);
extern
bool
switch_to_ns
(
pid_t
pid
,
const
char
*
ns
);
extern
int
lxc_config_define_add
(
struct
lxc_list
*
defines
,
char
*
arg
);
extern
int
lxc_config_define_load
(
struct
lxc_list
*
defines
,
struct
lxc_container
*
c
);
extern
bool
lxc_config_define_load
(
struct
lxc_list
*
defines
,
struct
lxc_container
*
c
);
extern
void
lxc_config_define_free
(
struct
lxc_list
*
defines
);
extern
int
lxc_char_left_gc
(
const
char
*
buffer
,
size_t
len
);
extern
int
lxc_char_right_gc
(
const
char
*
buffer
,
size_t
len
);
...
...
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