]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tools: use correct exit code for lxc-stop 1264/head
authorChristian Brauner <christian.brauner@canonical.com>
Sun, 30 Oct 2016 17:24:15 +0000 (18:24 +0100)
committerChristian Brauner <christian.brauner@canonical.com>
Sun, 30 Oct 2016 17:24:15 +0000 (18:24 +0100)
When the container is already running our manpage promises to exit with 2.
Let's make it so.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
src/lxc/tools/lxc_stop.c

index 498aac10ab4587b348714d2d57d3e3f3d2bb9e24..d87ed16e1380879f66c5400cb2033e447272953e 100644 (file)
@@ -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;
        }