]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_rmdir_onedev: don't fail if path doesn't exist
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 21 Sep 2015 17:01:10 +0000 (17:01 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 21 Sep 2015 20:47:35 +0000 (16:47 -0400)
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>
src/lxc/utils.c

index d6bb882d99530a0d6aad9e462bdb31ad318077f2..f10cba87bd567ed241010dbccef0e626e835c50f 100644 (file)
@@ -151,6 +151,8 @@ extern int lxc_rmdir_onedev(char *path)
        }
 
        if (lstat(path, &mystat) < 0) {
+               if (errno == ENOENT)
+                       return 0;
                ERROR("%s: failed to stat %s", __func__, path);
                return -1;
        }