From c01859e8ac5fa51ae7f2dd42caafd5ff5070f743 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Thu, 27 Aug 2015 15:12:26 -0500 Subject: [PATCH] fix open() results check to include 0 Signed-off-by: Serge Hallyn --- src/lxc/lxc_destroy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.2