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
7de8e0a9
Unverified
Commit
7de8e0a9
authored
Jul 26, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: s/strtok_r()/lxc_iterate_parts()/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
eb29852f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
17 deletions
+3
-17
lxc_autostart.c
src/lxc/tools/lxc_autostart.c
+1
-7
lxc_destroy.c
src/lxc/tools/lxc_destroy.c
+2
-10
No files found.
src/lxc/tools/lxc_autostart.c
View file @
7de8e0a9
...
...
@@ -194,8 +194,6 @@ static struct lxc_list *accumulate_list(char *input, char *delimiter,
static
struct
lxc_list
*
get_list
(
char
*
input
,
char
*
delimiter
)
{
char
*
workstr
=
NULL
;
char
*
workptr
=
NULL
;
char
*
sptr
=
NULL
;
char
*
token
=
NULL
;
struct
lxc_list
*
worklist
;
struct
lxc_list
*
workstr_list
;
...
...
@@ -212,11 +210,7 @@ static struct lxc_list *get_list(char *input, char *delimiter)
return
NULL
;
}
for
(
workptr
=
workstr
;;
workptr
=
NULL
)
{
token
=
strtok_r
(
workptr
,
delimiter
,
&
sptr
);
if
(
!
token
)
break
;
lxc_iterate_parts
(
token
,
workstr
,
delimiter
)
{
worklist
=
malloc
(
sizeof
(
*
worklist
));
if
(
!
worklist
)
break
;
...
...
src/lxc/tools/lxc_destroy.c
View file @
7de8e0a9
...
...
@@ -209,10 +209,8 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
char
*
buf
=
NULL
;
char
*
lxcpath
=
NULL
;
char
*
lxcname
=
NULL
;
char
*
scratch
=
NULL
;
int
fd
;
int
ret
;
int
counter
=
0
;
/* Destroy clones. */
ret
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/%s/lxc_snapshots"
,
c
->
config_path
,
c
->
name
);
...
...
@@ -244,15 +242,10 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
}
close
(
fd
);
while
((
lxcpath
=
strtok_r
(
!
counter
?
buf
:
NULL
,
"
\n
"
,
&
scratch
)))
{
if
(
!
(
lxcname
=
strtok_r
(
NULL
,
"
\n
"
,
&
scratch
)))
break
;
lxc_iterate_parts
(
lxcpath
,
buf
,
"
\n
"
)
{
c1
=
lxc_container_new
(
lxcname
,
lxcpath
);
if
(
!
c1
)
{
counter
++
;
if
(
!
c1
)
continue
;
}
/* We do not destroy recursively. If a clone of a clone
* has clones or snapshots the user should remove it
...
...
@@ -264,7 +257,6 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
}
lxc_container_put
(
c1
);
counter
++
;
}
free
(
buf
);
}
...
...
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