Skip to content

Commit

Permalink
lxccontainer: do_lxcapi_is_running()
Browse files Browse the repository at this point in the history
There's no need to do string comparisons.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Aug 23, 2018
1 parent b0f533e commit a19343b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/lxc/lxccontainer.c
Expand Up @@ -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)
Expand Down

0 comments on commit a19343b

Please sign in to comment.