From: Christian Brauner Date: Sun, 30 Oct 2016 17:24:15 +0000 (+0100) Subject: tools: use correct exit code for lxc-stop X-Git-Tag: lxc-2.1.0~283^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1264%2Fhead;p=thirdparty%2Flxc.git tools: use correct exit code for lxc-stop When the container is already running our manpage promises to exit with 2. Let's make it so. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/tools/lxc_stop.c b/src/lxc/tools/lxc_stop.c index 498aac10a..d87ed16e1 100644 --- a/src/lxc/tools/lxc_stop.c +++ b/src/lxc/tools/lxc_stop.c @@ -226,7 +226,10 @@ int main(int argc, char *argv[]) if (!c->is_running(c)) { fprintf(stderr, "%s is not running\n", c->name); - ret = EXIT_FAILURE; + /* Per our manpage we need to exit with exit code: + * 2: The specified container exists but was not running. + */ + ret = 2; goto out; }