ctx->target_host_uid = LXC_INVALID_UID;
ctx->target_host_gid = LXC_INVALID_GID;
- for (int i = 0; i < LXC_NS_MAX; i++)
+ for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++)
ctx->ns_fd[i] = -EBADF;
return ctx;
if (options->namespaces == -1)
return log_error_errno(-EINVAL, EINVAL, "Failed to automatically determine the namespaces which the container uses");
- for (int i = 0; i < LXC_NS_MAX; i++) {
+ for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) {
if (ns_info[i].clone_flag & CLONE_NEWCGROUP)
if (!(options->attach_flags & LXC_ATTACH_MOVE_TO_CGROUP) ||
!cgns_supported())
static int __prepare_namespaces_pidfd(struct attach_context *ctx)
{
- for (int i = 0; i < LXC_NS_MAX; i++) {
+ for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) {
int ret;
ret = same_nsfd(ctx->dfd_self_pid,
static int __prepare_namespaces_nsfd(struct attach_context *ctx,
lxc_attach_options_t *options)
{
- for (int i = 0; i < LXC_NS_MAX; i++) {
- int j;
+ for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) {
+ lxc_namespace_t j;
if (options->namespaces & ns_info[i].clone_flag)
ctx->ns_fd[i] = open_at(ctx->dfd_init_pid,
{
int fret = 0;
- for (int i = 0; i < LXC_NS_MAX; i++) {
+ for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) {
int ret;
if (ctx->ns_fd[i] < 0)
lxc_attach_options_t *options)
{
if (lxc_log_trace()) {
- for (int i = 0; i < LXC_NS_MAX; i++) {
+ for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) {
if (ns_info[i].clone_flag & options->namespaces) {
TRACE("Attaching to %s namespace", ns_info[i].proc_name);
continue;