From: Serge Hallyn Date: Thu, 27 Aug 2015 20:12:26 +0000 (-0500) Subject: fix open() results check to include 0 X-Git-Tag: lxc-2.0.0.beta1~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c01859e8ac5fa51ae7f2dd42caafd5ff5070f743;p=thirdparty%2Flxc.git fix open() results check to include 0 Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxc_destroy.c b/src/lxc/lxc_destroy.c index 6a5222007..8078b2fe6 100644 --- a/src/lxc/lxc_destroy.c +++ b/src/lxc/lxc_destroy.c @@ -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);