Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow safer PosixSpawnFileActions usage (#2491)
Many functions used for PosixSpawnFileActions were demanding fds passed implement the AsFd trait, but because these actions are meant to be taken in the child process, that trait doesn't offer much benefit and actually often leads to the caller needing to do an unsafe operation: instantiating an OwnedFd from a RawFd. All of these functions need a RawFd anyway, so just let the caller pass a RawFd directly rather than have to unsafely create an OwnedFd first, which itself could have unintended side effects like closing the FD in the parent when no parent-side actions were intended. Co-authored-by: Cameron Nemo <[email protected]>
- Loading branch information