Commit b93aac46 by Serge Hallyn

lxc-stop: exit with 1 or 2, not -1 or -2.

parent 01e6b714
...@@ -130,14 +130,14 @@ int main(int argc, char *argv[]) ...@@ -130,14 +130,14 @@ int main(int argc, char *argv[])
{ {
struct lxc_container *c; struct lxc_container *c;
bool s; bool s;
int ret = -1; int ret = 1;
if (lxc_arguments_parse(&my_args, argc, argv)) if (lxc_arguments_parse(&my_args, argc, argv))
return -1; return 1;
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority, if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0])) my_args.progname, my_args.quiet, my_args.lxcpath[0]))
return -1; return 1;
c = lxc_container_new(my_args.name, my_args.lxcpath[0]); c = lxc_container_new(my_args.name, my_args.lxcpath[0]);
if (!c) { if (!c) {
...@@ -147,12 +147,12 @@ int main(int argc, char *argv[]) ...@@ -147,12 +147,12 @@ int main(int argc, char *argv[])
if (!c->is_running(c)) { if (!c->is_running(c)) {
fprintf(stderr, "%s is not running\n", c->name); fprintf(stderr, "%s is not running\n", c->name);
ret = -2; ret = 2;
goto out; goto out;
} }
if (my_args.hardstop) { if (my_args.hardstop) {
ret = c->stop(c) ? 0 : -1; ret = c->stop(c) ? 0 : 1;
goto out; goto out;
} }
if (my_args.reboot) { if (my_args.reboot) {
...@@ -163,9 +163,9 @@ int main(int argc, char *argv[]) ...@@ -163,9 +163,9 @@ int main(int argc, char *argv[])
s = c->shutdown(c, my_args.timeout); s = c->shutdown(c, my_args.timeout);
if (!s) { if (!s) {
if (!my_args.shutdown) if (!my_args.shutdown)
ret = c->wait(c, "STOPPED", -1) ? 0 : -1; ret = c->wait(c, "STOPPED", -1) ? 0 : 1;
else else
ret = -1; // fail ret = 1; // fail
} else } else
ret = 0; ret = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment