Skip to content

Commit

Permalink
attach: s/lxc_proc_close_ns_fd/close_nsfds/g
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 26, 2021
1 parent f10aba1 commit a1200f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lxc/attach.c
Expand Up @@ -228,7 +228,7 @@ static int get_attach_context_nsfds(struct attach_context *ctx,
return 0;
}

static inline void lxc_proc_close_ns_fd(struct attach_context *ctx)
static inline void close_nsfds(struct attach_context *ctx)
{
for (int i = 0; i < LXC_NS_MAX; i++)
close_prot_errno_disarm(ctx->ns_fd[i]);
Expand All @@ -243,7 +243,7 @@ static void put_attach_context(struct attach_context *ctx)
ctx->container = NULL;
}

lxc_proc_close_ns_fd(ctx);
close_nsfds(ctx);
free(ctx);
}

Expand Down Expand Up @@ -1056,7 +1056,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
ret = get_attach_context(ctx, container);
if (ret) {
ERROR("Failed to get attach context");
lxc_container_put(container);
put_attach_context(ctx);
return -1;
}

Expand Down Expand Up @@ -1202,7 +1202,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
}

/* close namespace file descriptors */
lxc_proc_close_ns_fd(ctx);
close_nsfds(ctx);

/* Attach succeeded, try to cwd. */
if (options->initial_cwd)
Expand Down Expand Up @@ -1272,7 +1272,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
/* close unneeded file descriptors */
close(ipc_sockets[1]);
free_disarm(cwd);
lxc_proc_close_ns_fd(ctx);
close_nsfds(ctx);
if (options->attach_flags & LXC_ATTACH_TERMINAL)
lxc_attach_terminal_close_pts(&terminal);

Expand Down

0 comments on commit a1200f8

Please sign in to comment.