Commit 4d44e274 by Serge Hallyn

fix coverity-found errors.

parent 00b6be44
......@@ -700,7 +700,8 @@ static int setup_tty(const struct lxc_rootfs *rootfs,
SYSERROR("error creating %s\n", lxcpath);
return -1;
}
close(ret);
if (ret >= 0)
close(ret);
ret = unlink(path);
if (ret && errno != ENOENT) {
SYSERROR("error unlinking %s\n", path);
......@@ -1314,7 +1315,8 @@ static int setup_ttydir_console(const struct lxc_rootfs *rootfs,
SYSERROR("error %d creating %s\n", errno, lxcpath);
return -1;
}
close(ret);
if (ret >= 0)
close(ret);
if (console->peer == -1) {
INFO("no console output required");
......
......@@ -53,7 +53,7 @@ pid_t lxc_clone(int (*fn)(void *), void *arg, int flags)
.arg = arg,
};
long stack_size = sysconf(_SC_PAGESIZE);
size_t stack_size = sysconf(_SC_PAGESIZE);
void *stack = alloca(stack_size);
pid_t ret;
......
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