Unverified Commit a01dec48 by 2xsec Committed by Christian Brauner

attach: fix return value & cleanups

Signed-off-by: 's avatar2xsec <dh48.jeong@samsung.com>
parent 96d48ff3
......@@ -868,12 +868,16 @@ int lxc_init(const char *name, struct lxc_handler *handler)
out_delete_terminal:
lxc_terminal_delete(&handler->conf->console);
out_restore_sigmask:
(void)pthread_sigmask(SIG_SETMASK, &handler->oldmask, NULL);
out_delete_tty:
lxc_delete_tty(&conf->ttys);
out_aborting:
(void)lxc_set_state(name, handler, ABORTING);
out_close_maincmd_fd:
lxc_abstract_unix_close(conf->maincmd_fd);
conf->maincmd_fd = -1;
......
......@@ -2038,9 +2038,10 @@ int lxc_preserve_ns(const int pid, const char *ns)
ret = snprintf(path, __NS_PATH_LEN, "/proc/%d/ns%s%s", pid,
!ns || strcmp(ns, "") == 0 ? "" : "/",
!ns || strcmp(ns, "") == 0 ? "" : ns);
errno = EFBIG;
if (ret < 0 || (size_t)ret >= __NS_PATH_LEN)
return -EFBIG;
if (ret < 0 || (size_t)ret >= __NS_PATH_LEN) {
errno = EFBIG;
return -1;
}
return open(path, O_RDONLY | O_CLOEXEC);
}
......
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