]> git.proxmox.com Git - mirror_lxc.git/commitdiff
lxccontainer: do_lxcapi_is_running()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 29 Apr 2018 12:49:36 +0000 (14:49 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 29 Apr 2018 12:49:36 +0000 (14:49 +0200)
There's no need to do string comparisons.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxccontainer.c

index 839bd30655f926c092ada003242bdd8e3da31735..3e162d269a1e1b455e225a0580dd3eeff81240d7 100644 (file)
@@ -482,16 +482,10 @@ static bool is_stopped(struct lxc_container *c)
 
 static bool do_lxcapi_is_running(struct lxc_container *c)
 {
-       const char *s;
-
        if (!c)
                return false;
 
-       s = do_lxcapi_state(c);
-       if (!s || strcmp(s, "STOPPED") == 0)
-               return false;
-
-       return true;
+       return !is_stopped(c);
 }
 
 WRAP_API(bool, lxcapi_is_running)