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
a3c089a7
Unverified
Commit
a3c089a7
authored
Feb 19, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start: lxc_destroy_container_on_signal()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
ba7d715b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
start.c
src/lxc/start.c
+9
-8
No files found.
src/lxc/start.c
View file @
a3c089a7
...
@@ -1904,28 +1904,29 @@ static void lxc_destroy_container_on_signal(struct lxc_handler *handler,
...
@@ -1904,28 +1904,29 @@ static void lxc_destroy_container_on_signal(struct lxc_handler *handler,
const
char
*
name
)
const
char
*
name
)
{
{
char
destroy
[
MAXPATHLEN
];
char
destroy
[
MAXPATHLEN
];
bool
bret
=
true
;
int
ret
=
0
;
struct
lxc_container
*
c
;
struct
lxc_container
*
c
;
int
ret
=
0
;
bool
bret
=
true
;
if
(
handler
->
conf
->
rootfs
.
path
&&
handler
->
conf
->
rootfs
.
mount
)
{
if
(
handler
->
conf
->
rootfs
.
path
&&
handler
->
conf
->
rootfs
.
mount
)
{
bret
=
do_destroy_container
(
handler
);
bret
=
do_destroy_container
(
handler
);
if
(
!
bret
)
{
if
(
!
bret
)
{
ERROR
(
"Error destroying rootfs for container
\"
%s
\"
.
"
,
name
);
ERROR
(
"Error destroying rootfs for container
\"
%s
\"
"
,
name
);
return
;
return
;
}
}
}
}
INFO
(
"Destroyed rootfs for container
\"
%s
\"
.
"
,
name
);
INFO
(
"Destroyed rootfs for container
\"
%s
\"
"
,
name
);
ret
=
snprintf
(
destroy
,
MAXPATHLEN
,
"%s/%s"
,
handler
->
lxcpath
,
name
);
ret
=
snprintf
(
destroy
,
MAXPATHLEN
,
"%s/%s"
,
handler
->
lxcpath
,
name
);
if
(
ret
<
0
||
ret
>=
MAXPATHLEN
)
{
if
(
ret
<
0
||
ret
>=
MAXPATHLEN
)
{
ERROR
(
"Error destroying directory for container
\"
%s
\"
.
"
,
name
);
ERROR
(
"Error destroying directory for container
\"
%s
\"
"
,
name
);
return
;
return
;
}
}
c
=
lxc_container_new
(
name
,
handler
->
lxcpath
);
c
=
lxc_container_new
(
name
,
handler
->
lxcpath
);
if
(
c
)
{
if
(
c
)
{
if
(
container_disk_lock
(
c
))
{
if
(
container_disk_lock
(
c
))
{
INFO
(
"Could not update lxc_snapshots file
.
"
);
INFO
(
"Could not update lxc_snapshots file"
);
lxc_container_put
(
c
);
lxc_container_put
(
c
);
}
else
{
}
else
{
mod_all_rdeps
(
c
,
false
);
mod_all_rdeps
(
c
,
false
);
...
@@ -1941,10 +1942,10 @@ static void lxc_destroy_container_on_signal(struct lxc_handler *handler,
...
@@ -1941,10 +1942,10 @@ static void lxc_destroy_container_on_signal(struct lxc_handler *handler,
ret
=
lxc_rmdir_onedev
(
destroy
,
NULL
);
ret
=
lxc_rmdir_onedev
(
destroy
,
NULL
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"Error destroying directory for container
\"
%s
\"
.
"
,
name
);
ERROR
(
"Error destroying directory for container
\"
%s
\"
"
,
name
);
return
;
return
;
}
}
INFO
(
"Destroyed directory for container
\"
%s
\"
.
"
,
name
);
INFO
(
"Destroyed directory for container
\"
%s
\"
"
,
name
);
}
}
static
int
lxc_rmdir_onedev_wrapper
(
void
*
data
)
static
int
lxc_rmdir_onedev_wrapper
(
void
*
data
)
...
...
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