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
15436995
Unverified
Commit
15436995
authored
Dec 08, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: cleanup set_config_group()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
cb5f3df2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
17 deletions
+11
-17
confile.c
src/lxc/confile.c
+11
-17
No files found.
src/lxc/confile.c
View file @
15436995
...
...
@@ -1358,40 +1358,34 @@ static int set_config_monitor_signal_pdeath(const char *key, const char *value,
static
int
set_config_group
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
char
*
groups
,
*
token
;
struct
lxc_list
*
grouplist
;
int
ret
=
0
;
__do_free
char
*
groups
=
NULL
;
char
*
token
;
if
(
lxc_config_value_empty
(
value
))
return
lxc_clear_groups
(
lxc_conf
);
groups
=
strdup
(
value
);
if
(
!
groups
)
return
-
1
;
return
ret_errno
(
ENOMEM
)
;
/* In case several groups are specified in a single line split these
* groups in a single element for the list.
*/
lxc_iterate_parts
(
token
,
groups
,
"
\t
"
)
{
__do_free
struct
lxc_list
*
grouplist
=
NULL
;
grouplist
=
malloc
(
sizeof
(
*
grouplist
));
if
(
!
grouplist
)
{
ret
=
-
1
;
break
;
}
if
(
!
grouplist
)
return
ret_errno
(
ENOMEM
);
grouplist
->
elem
=
strdup
(
token
);
if
(
!
grouplist
->
elem
)
{
free
(
grouplist
);
ret
=
-
1
;
break
;
}
if
(
!
grouplist
->
elem
)
return
ret_errno
(
ENOMEM
);
lxc_list_add_tail
(
&
lxc_conf
->
groups
,
grouplist
);
lxc_list_add_tail
(
&
lxc_conf
->
groups
,
move_ptr
(
grouplist
)
);
}
free
(
groups
);
return
ret
;
return
0
;
}
static
int
set_config_environment
(
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