From: Serge Hallyn Date: Mon, 21 Sep 2015 17:01:10 +0000 (+0000) Subject: lxc_rmdir_onedev: don't fail if path doesn't exist X-Git-Tag: lxc-2.0.0.beta1~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=067650d0b6ac73b27e5b4ae3e0fc4fbf3b2f9e6c;p=thirdparty%2Flxc.git lxc_rmdir_onedev: don't fail if path doesn't exist 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 --- 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; }