Unverified Commit d5191538 by Christian Brauner Committed by Stéphane Graber

tools: remove empty snap directory

parent 7f79cc4c
......@@ -171,7 +171,7 @@ static bool do_destroy(struct lxc_container *c)
if (ret < 0 || ret >= MAXPATHLEN)
return false;
if (dir_exists(path)) {
if (rmdir(path) < 0 && errno != ENOENT) {
if (!quiet)
fprintf(stdout, "Destroying %s failed: %s has snapshots.\n", c->name, c->name);
return false;
......@@ -271,7 +271,7 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
if (ret < 0 || ret >= MAXPATHLEN)
return false;
if (dir_exists(path))
if (rmdir(path) < 0 && errno != ENOENT)
bret = c->destroy_with_snapshots(c);
else
bret = do_destroy(c);
......
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