Commit c01859e8 by Serge Hallyn

fix open() results check to include 0

parent 19712e04
...@@ -154,7 +154,7 @@ static int do_destroy_with_snapshots(struct lxc_container *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); ret = snprintf(path, MAXPATHLEN, "%s/%s/lxc_snapshots", c->config_path, c->name);
fd = open(path, O_RDONLY | O_CLOEXEC); fd = open(path, O_RDONLY | O_CLOEXEC);
if (fd > 0) { if (fd >= 0) {
ret = fstat(fd, &fbuf); ret = fstat(fd, &fbuf);
if (ret < 0) { if (ret < 0) {
close(fd); close(fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment