From a19343bc0ef3274ee1a3f75ef65f23499d1f615d Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sun, 29 Apr 2018 14:49:36 +0200 Subject: [PATCH] lxccontainer: do_lxcapi_is_running() There's no need to do string comparisons. Signed-off-by: Christian Brauner --- src/lxc/lxccontainer.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 3a4a35778..3b7268518 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -478,16 +478,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) -- 2.47.2