We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b3261a commit 0e6e256Copy full SHA for 0e6e256
1 file changed
crates/stdlib/src/posixsubprocess.rs
@@ -441,15 +441,14 @@ fn close_dir_fds(keep: KeepFds<'_>) -> nix::Result<()> {
441
fn close_filetable_fds(keep: KeepFds<'_>) -> nix::Result<()> {
442
use nix::fcntl;
443
use std::os::fd::{FromRawFd, OwnedFd};
444
- let fd = fcntl::open(
+ let filetable = fcntl::open(
445
c"/scheme/thisproc/current/filetable",
446
fcntl::OFlag::O_RDONLY,
447
nix::sys::stat::Mode::empty(),
448
)?;
449
- let filetable = unsafe { OwnedFd::from_raw_fd(fd) };
450
let read_one = || -> nix::Result<_> {
451
let mut byte = 0;
452
- let n = nix::unistd::read(filetable.as_raw_fd(), std::slice::from_mut(&mut byte))?;
+ let n = nix::unistd::read(&filetable, std::slice::from_mut(&mut byte))?;
453
Ok((n > 0).then_some(byte))
454
};
455
while let Some(c) = read_one()? {
0 commit comments