Commit f72d69f6 by Serge Hallyn Committed by Stéphane Graber

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: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 75b110ea
...@@ -151,6 +151,8 @@ extern int lxc_rmdir_onedev(char *path) ...@@ -151,6 +151,8 @@ extern int lxc_rmdir_onedev(char *path)
} }
if (lstat(path, &mystat) < 0) { if (lstat(path, &mystat) < 0) {
if (errno == ENOENT)
return 0;
ERROR("%s: failed to stat %s", __func__, path); ERROR("%s: failed to stat %s", __func__, path);
return -1; return -1;
} }
......
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