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

stdin/stdout/stderr now implement AsRawFd #11

Open
oconnor663 opened this issue Oct 10, 2017 · 1 comment
Open

stdin/stdout/stderr now implement AsRawFd #11

oconnor663 opened this issue Oct 10, 2017 · 1 comment

Comments

@oconnor663
Copy link
Owner

This will land in 1.21. We might want to incorporate it: rust-lang/rust#43459

@oconnor663
Copy link
Owner Author

Right now the ImplStdio trait assumes that it can take ownership of the underlying file descriptor. The Stdin/Stdout/Stderr types only implement AsRawFd, and not IntoRawFd, because taking ownership of those fd's would be a terrible idea. We might want to switch to an implementation that always dups the underlying fd, and takes an AsRawFd bound, to work better with these new methods.

ebkalderon added a commit to ebkalderon/bastille that referenced this issue Nov 25, 2019
This is for the same reason as the author of the `os_pipe` crate stated
in oconnor663/os_pipe.rs#11, that it is generally a bad idea to take
full ownership of the pipes' file descriptors and usually isn't what you
want to do when you call the method.
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

No branches or pull requests

1 participant