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

Take OwnedFd instead of RawFd as argument to receive_to_fd #408

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Sep 22, 2023

This appears to be the only use of RawFd in a public API. With this change, these functions should be safe to call.

I'm not sure if it would make more sense for these functions to not close the file descriptor. In which case they could take BorrowedFd. But this matches the current implementation, but with an IO safe type.

This appears to be the only use of `RawFd` in a public API. With this
change, these functions should be safe to call.

I'm not sure if it would make more sense for these functions to not
close the file descriptor. In which case they could take `BorrowedFd`.
But this matches the current implementation, but with an IO safe type.
@ids1024
Copy link
Member Author

ids1024 commented Sep 22, 2023

Ah, I guess it does make sense to use OwnedFd rather than BorrowedFd since it's expected to be used with pipes, waiting for EOF on the receiver. Which would depend on not having another copy of the sender held open. So this API should be appropriate.

@wash2 wash2 merged commit 08f6081 into Smithay:master Sep 22, 2023
6 checks passed
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