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
1c6e971f
Unverified
Commit
1c6e971f
authored
Dec 08, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: cleanup set_config_environment()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
cf7daa76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
confile.c
src/lxc/confile.c
+5
-10
No files found.
src/lxc/confile.c
View file @
1c6e971f
...
@@ -1310,14 +1310,14 @@ static int set_config_group(const char *key, const char *value,
...
@@ -1310,14 +1310,14 @@ static int set_config_group(const char *key, const char *value,
static
int
set_config_environment
(
const
char
*
key
,
const
char
*
value
,
static
int
set_config_environment
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
{
struct
lxc_list
*
list_item
=
NULL
;
__do_free
struct
lxc_list
*
list_item
=
NULL
;
if
(
lxc_config_value_empty
(
value
))
if
(
lxc_config_value_empty
(
value
))
return
lxc_clear_environment
(
lxc_conf
);
return
lxc_clear_environment
(
lxc_conf
);
list_item
=
malloc
(
sizeof
(
*
list_item
));
list_item
=
malloc
(
sizeof
(
*
list_item
));
if
(
!
list_item
)
if
(
!
list_item
)
goto
on_error
;
return
ret_errno
(
ENOMEM
)
;
if
(
!
strchr
(
value
,
'='
))
{
if
(
!
strchr
(
value
,
'='
))
{
const
char
*
env_val
;
const
char
*
env_val
;
...
@@ -1326,7 +1326,7 @@ static int set_config_environment(const char *key, const char *value,
...
@@ -1326,7 +1326,7 @@ static int set_config_environment(const char *key, const char *value,
env_val
=
getenv
(
env_key
);
env_val
=
getenv
(
env_key
);
if
(
!
env_val
)
if
(
!
env_val
)
goto
on_error
;
return
ret_errno
(
ENOENT
)
;
env_var
[
0
]
=
env_key
;
env_var
[
0
]
=
env_key
;
env_var
[
1
]
=
env_val
;
env_var
[
1
]
=
env_val
;
...
@@ -1336,16 +1336,11 @@ static int set_config_environment(const char *key, const char *value,
...
@@ -1336,16 +1336,11 @@ static int set_config_environment(const char *key, const char *value,
}
}
if
(
!
list_item
->
elem
)
if
(
!
list_item
->
elem
)
goto
on_error
;
return
ret_errno
(
ENOMEM
)
;
lxc_list_add_tail
(
&
lxc_conf
->
environment
,
list_item
);
lxc_list_add_tail
(
&
lxc_conf
->
environment
,
move_ptr
(
list_item
)
);
return
0
;
return
0
;
on_error:
free
(
list_item
);
return
-
1
;
}
}
static
int
set_config_tty_max
(
const
char
*
key
,
const
char
*
value
,
static
int
set_config_tty_max
(
const
char
*
key
,
const
char
*
value
,
...
...
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