]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fix open() results check to include 0
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 27 Aug 2015 20:12:26 +0000 (15:12 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 27 Aug 2015 20:14:28 +0000 (15:14 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_destroy.c

index 6a522200765be36797a4ab0aecb4b2ef26b4e44c..8078b2fe6ea3178cd2104902ca62063458a3f310 100644 (file)
@@ -154,7 +154,7 @@ static int do_destroy_with_snapshots(struct lxc_container *c)
        ret = snprintf(path, MAXPATHLEN, "%s/%s/lxc_snapshots", c->config_path, c->name);
 
        fd = open(path, O_RDONLY | O_CLOEXEC);
-       if (fd > 0) {
+       if (fd >= 0) {
                ret = fstat(fd, &fbuf);
                if (ret < 0) {
                        close(fd);