Skip to content

init: use *os.File for passed file descriptors#4175

Merged
kolyshkin merged 1 commit into
opencontainers:mainfrom
cyphar:fd-file-switch
Jan 31, 2024
Merged

init: use *os.File for passed file descriptors#4175
kolyshkin merged 1 commit into
opencontainers:mainfrom
cyphar:fd-file-switch

Conversation

@cyphar
Copy link
Copy Markdown
Member

@cyphar cyphar commented Jan 20, 2024

While it doesn't make much of a practical difference, it seems far more reasonable to use os.NewFile to wrap all of our passed file descriptors to make sure they're tracked by the Go runtime and that we don't double-close them.

Signed-off-by: Aleksa Sarai cyphar@cyphar.com

@cyphar cyphar added this to the 1.2.0 milestone Jan 20, 2024
Comment thread libcontainer/utils/utils_unix.go Outdated
While it doesn't make much of a practical difference, it seems far more
reasonable to use os.NewFile to wrap all of our passed file descriptors
to make sure they're tracked by the Go runtime and that we don't
double-close them.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
@lifubang
Copy link
Copy Markdown
Member

lifubang commented Jan 22, 2024

I have updated #4173 , but after I see this PR, I think these two PRs are related, could you mind carry #4173 in here?
Sorry, no related.

Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kolyshkin kolyshkin merged commit 8454bbb into opencontainers:main Jan 31, 2024
@cyphar cyphar deleted the fd-file-switch branch January 31, 2024 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants