We're asked to delete it, don't fail if it doesn't exist.

This stops lxc-destroy from failing when the container isn't fully
built.

Signed-off-by: Serge Hallyn <serge.hal...@ubuntu.com>
---
 src/lxc/utils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/lxc/utils.c b/src/lxc/utils.c
index 7ced314..0b83960 100644
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -197,6 +197,8 @@ extern int lxc_rmdir_onedev(char *path, const char *exclude)
        }
 
        if (lstat(path, &mystat) < 0) {
+               if (errno == ENOENT)
+                       return 0;
                ERROR("%s: failed to stat %s", __func__, path);
                return -1;
        }
-- 
2.5.0

_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to