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 <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Serge Hallyn 2015-09-21 17:01:10 +00:00 committed by Stéphane Graber
parent 776d170c5e
commit 067650d0b6

View File

@ -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;
}