Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add custom Drop that drops the clock device if needed #5

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

folkertdev
Copy link
Collaborator

this is kind of the right thing to do, but does mean that the clock is no longer clone or copy

@folkertdev folkertdev force-pushed the custom-drop branch 2 times, most recently from 32b5295 to 52cd2f4 Compare October 4, 2023 10:00
Comment on lines +452 to +461
// an error is unlikely (source: https://linux.die.net/man/2/dup2)
//
// - EBADF cannot happen, the fd we provide is valid
// - EMFILE it is unlikely that the process runs out of file descriptors
//
// The other errors are only returned by dup2 and dup3
match unsafe { libc::dup(fd) } {
-1 => panic!("{:?}", convert_errno()),
new_fd => Self::safe_from_raw_fd(new_fd),
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we can do better than this. And hey, when you run out of fd's you're doing something weird and it's not really our problem

@davidv1992 davidv1992 merged commit 198730f into sys-offset-support Oct 4, 2023
6 checks passed
@rnijveld rnijveld deleted the custom-drop branch January 24, 2024 11:10
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.

2 participants