From: Serge Hallyn Date: Wed, 14 Aug 2013 19:58:48 +0000 (-0500) Subject: lxc_destroy: print an error if the container is not defined. X-Git-Tag: lxc-1.0.0.alpha1~1^2~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01e6b7148046c3f41849d093bc61454279792b80;p=thirdparty%2Flxc.git lxc_destroy: print an error if the container is not defined. Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxc_destroy.c b/src/lxc/lxc_destroy.c index 9a1b11fba..0724eb808 100644 --- a/src/lxc/lxc_destroy.c +++ b/src/lxc/lxc_destroy.c @@ -84,9 +84,16 @@ int main(int argc, char *argv[]) exit(1); } + if (!c->is_defined(c)) { + fprintf(stderr, "Container is not defined\n"); + lxc_container_put(c); + exit(1); + } + if (c->is_running(c)) { if (!my_args.force) { fprintf(stderr, "%s is running\n", my_args.name); + lxc_container_put(c); exit(1); } c->stop(c);