]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tools: use correct exit code for lxc-stop
authorChristian Brauner <christian.brauner@canonical.com>
Sun, 30 Oct 2016 17:24:15 +0000 (18:24 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 18 Nov 2016 01:35:24 +0000 (20:35 -0500)
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/lxc_stop.c

index 10ddce6a9e3697eaf90c738e1554c4c5d61d6b14..78a483efb569835628d78852b5726fcefa36d21a 100644 (file)
@@ -210,6 +210,9 @@ int main(int argc, char *argv[])
 
        if (!c->is_running(c)) {
                fprintf(stderr, "%s is not running\n", c->name);
+               /* Per our manpage we need to exit with exit code:
+                * 2: The specified container exists but was not running.
+                */
                ret = 2;
                goto out;
        }