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
79507e49
Commit
79507e49
authored
May 18, 2009
by
Michel Normand
Committed by
Daniel Lezcano
May 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc-destroy return 255 in case of error
to have same exit code for all lxc commands Signed-off-by:
Michel Normand
<
normand@fr.ibm.com
>
Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
7f830613
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
15 deletions
+7
-15
destroy.c
src/lxc/destroy.c
+3
-3
lxc_destroy.c
src/lxc/lxc_destroy.c
+4
-12
No files found.
src/lxc/destroy.c
View file @
79507e49
...
...
@@ -39,7 +39,7 @@ static int remove_lxc_directory(const char *dirname)
{
char
path
[
MAXPATHLEN
];
s
printf
(
path
,
LXCPATH
"/%s"
,
dirname
);
s
nprintf
(
path
,
MAXPATHLEN
,
LXCPATH
"/%s"
,
dirname
);
if
(
rmdir
(
path
))
{
SYSERROR
(
"failed to remove %s directory"
,
path
);
...
...
@@ -51,12 +51,12 @@ static int remove_lxc_directory(const char *dirname)
int
lxc_destroy
(
const
char
*
name
)
{
int
lock
,
ret
=
-
LXC_ERROR_INTERNAL
;
int
lock
,
ret
=
-
1
;
char
path
[
MAXPATHLEN
];
lock
=
lxc_get_lock
(
name
);
if
(
lock
<
0
)
return
lock
;
return
ret
;
if
(
lxc_rmstate
(
name
))
{
ERROR
(
"failed to remove state file for %s"
,
name
);
...
...
src/lxc/lxc_destroy.c
View file @
79507e49
...
...
@@ -22,7 +22,6 @@
*/
#include <stdio.h>
#include <unistd.h>
#include <libgen.h>
#include <sys/types.h>
#include <lxc/lxc.h>
...
...
@@ -48,20 +47,13 @@ Options :\n\
int
main
(
int
argc
,
char
*
argv
[])
{
int
ret
;
ret
=
lxc_arguments_parse
(
&
my_args
,
argc
,
argv
);
if
(
ret
)
return
1
;
if
(
lxc_arguments_parse
(
&
my_args
,
argc
,
argv
))
return
-
1
;
if
(
lxc_log_init
(
my_args
.
log_file
,
my_args
.
log_priority
,
my_args
.
progname
,
my_args
.
quiet
))
return
1
;
ret
=
lxc_destroy
(
my_args
.
name
);
if
(
ret
)
return
1
;
return
-
1
;
return
0
;
return
lxc_destroy
(
my_args
.
name
)
;
}
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