Revert "tools: remove empty snap directory"

This reverts commit d5191538. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 75ffcb1b
...@@ -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 (rmdir(path) < 0 && errno != ENOENT) { if (dir_exists(path)) {
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 (rmdir(path) < 0 && errno != ENOENT) if (dir_exists(path))
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