fix coverity-found errors.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Serge Hallyn 2013-04-14 22:57:46 -05:00
parent 00b6be440f
commit 4d44e274dc
2 changed files with 5 additions and 3 deletions

View File

@ -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");

View File

@ -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;