lxccontainer: do_lxcapi_is_running()

There's no need to do string comparisons. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent b0f533e2
...@@ -478,16 +478,10 @@ static bool is_stopped(struct lxc_container *c) ...@@ -478,16 +478,10 @@ static bool is_stopped(struct lxc_container *c)
static bool do_lxcapi_is_running(struct lxc_container *c) static bool do_lxcapi_is_running(struct lxc_container *c)
{ {
const char *s;
if (!c) if (!c)
return false; return false;
s = do_lxcapi_state(c); return !is_stopped(c);
if (!s || strcmp(s, "STOPPED") == 0)
return false;
return true;
} }
WRAP_API(bool, lxcapi_is_running) WRAP_API(bool, lxcapi_is_running)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment