]> 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 17:25:25 +0000 (13:25 -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 7ced314872ac4bbca21d9e564f6188d95163db68..0b83960b140db709822a56d83da9cb3f25932b03 100644 (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;
        }