From 067650d0b6ac73b27e5b4ae3e0fc4fbf3b2f9e6c Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Mon, 21 Sep 2015 17:01:10 +0000 Subject: [PATCH] lxc_rmdir_onedev: don't fail if path doesn't exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Stéphane Graber --- src/lxc/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lxc/utils.c b/src/lxc/utils.c index 7ced31487..0b83960b1 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; }