mirror of
git://github.com/lxc/lxc
synced 2025-08-31 14:09:56 +00:00
lxc-checkpoint ad lxc-restart to return 255 in case of error
to have same exit code for all lxc commands Note that the lxc-restart is not yet reporting the error of restarted application as done with lxc-start. Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
committed by
Daniel Lezcano
parent
c8f55b0eff
commit
a30284df84
@@ -69,18 +69,17 @@ Options :\n\
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ret;
|
||||
int ret = -1;
|
||||
|
||||
ret = lxc_arguments_parse(&my_args, argc, argv);
|
||||
if (ret)
|
||||
return 1;
|
||||
if (lxc_arguments_parse(&my_args, argc, argv))
|
||||
return ret;
|
||||
|
||||
if (lxc_log_init(my_args.log_file, my_args.log_priority,
|
||||
my_args.progname, my_args.quiet))
|
||||
return -1;
|
||||
return ret;
|
||||
|
||||
if (lxc_freeze(my_args.name))
|
||||
return -1;
|
||||
return ret;
|
||||
|
||||
if (lxc_checkpoint(my_args.name, my_args.argv[0], 0))
|
||||
goto out;
|
||||
@@ -94,7 +93,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
out:
|
||||
if (lxc_unfreeze(my_args.name))
|
||||
return 1;
|
||||
return -1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -58,18 +58,15 @@ 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;
|
||||
return -1;
|
||||
|
||||
if (lxc_restart(my_args.name, my_args.argv[0], 0))
|
||||
return 1;
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user