Skip to content

Commit 14fa6a5

Browse files
committed
libcrun/container: Provide container pointer when closing fds
Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
1 parent a7b9774 commit 14fa6a5

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/libcrun/container.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,7 @@ container_init (void *args, char *notify_socket, int sync_socket, libcrun_error_
16701670
if (entrypoint_args->custom_handler->vtable->close_fds)
16711671
{
16721672
ret = entrypoint_args->custom_handler->vtable->close_fds (entrypoint_args->custom_handler->cookie,
1673+
entrypoint_args->container,
16731674
entrypoint_args->context->preserve_fds);
16741675
}
16751676
else

src/libcrun/custom-handler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct custom_handler_s
4949
runtime_spec_schema_config_schema *def,
5050
libcrun_error_t *err);
5151

52-
int (*close_fds) (void *cookie, int preserve_fds);
52+
int (*close_fds) (void *cookie, libcrun_container_t *container, int preserve_fds);
5353
};
5454

5555
struct custom_handler_manager_s;

src/libcrun/handlers/krun.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ libkrun_modify_oci_configuration (void *cookie arg_unused, libcrun_context_t *co
852852
}
853853

854854
static int
855-
libkrun_close_fds (void *cookie, int preserve_fds)
855+
libkrun_close_fds (void *cookie, libcrun_container_t *container, int preserve_fds)
856856
{
857857
struct krun_config *kconf = (struct krun_config *) cookie;
858858
int first_fd_to_close = preserve_fds + 3;
@@ -884,7 +884,7 @@ libkrun_close_fds (void *cookie, int preserve_fds)
884884
first_fd_to_close = high_passt_fd + 1;
885885
}
886886

887-
return mark_or_close_fds_ge_than (first_fd_to_close, true, NULL);
887+
return mark_or_close_fds_ge_than (container, first_fd_to_close, true, NULL);
888888
}
889889

890890
struct custom_handler_s handler_libkrun = {

0 commit comments

Comments
 (0)