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