From: Serge Hallyn Date: Wed, 14 Aug 2013 20:01:40 +0000 (-0500) Subject: lxc-stop: exit with 1 or 2, not -1 or -2. X-Git-Tag: lxc-1.0.0.alpha1~1^2~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b93aac46f2802b3639c1ac2ed0cf71174673d110;p=thirdparty%2Flxc.git lxc-stop: exit with 1 or 2, not -1 or -2. Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxc_stop.c b/src/lxc/lxc_stop.c index d7f8d7fdc..6c3be738b 100644 --- a/src/lxc/lxc_stop.c +++ b/src/lxc/lxc_stop.c @@ -130,14 +130,14 @@ int main(int argc, char *argv[]) { struct lxc_container *c; bool s; - int ret = -1; + int ret = 1; 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, 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]); if (!c) { @@ -147,12 +147,12 @@ int main(int argc, char *argv[]) if (!c->is_running(c)) { fprintf(stderr, "%s is not running\n", c->name); - ret = -2; + ret = 2; goto out; } if (my_args.hardstop) { - ret = c->stop(c) ? 0 : -1; + ret = c->stop(c) ? 0 : 1; goto out; } if (my_args.reboot) { @@ -163,9 +163,9 @@ int main(int argc, char *argv[]) s = c->shutdown(c, my_args.timeout); if (!s) { if (!my_args.shutdown) - ret = c->wait(c, "STOPPED", -1) ? 0 : -1; + ret = c->wait(c, "STOPPED", -1) ? 0 : 1; else - ret = -1; // fail + ret = 1; // fail } else ret = 0;