Skip to content

Commit 0e6e256

Browse files
authored
Fix redox compilation in stdlib (#6298)
1 parent 1b3261a commit 0e6e256

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crates/stdlib/src/posixsubprocess.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,14 @@ fn close_dir_fds(keep: KeepFds<'_>) -> nix::Result<()> {
441441
fn close_filetable_fds(keep: KeepFds<'_>) -> nix::Result<()> {
442442
use nix::fcntl;
443443
use std::os::fd::{FromRawFd, OwnedFd};
444-
let fd = fcntl::open(
444+
let filetable = fcntl::open(
445445
c"/scheme/thisproc/current/filetable",
446446
fcntl::OFlag::O_RDONLY,
447447
nix::sys::stat::Mode::empty(),
448448
)?;
449-
let filetable = unsafe { OwnedFd::from_raw_fd(fd) };
450449
let read_one = || -> nix::Result<_> {
451450
let mut byte = 0;
452-
let n = nix::unistd::read(filetable.as_raw_fd(), std::slice::from_mut(&mut byte))?;
451+
let n = nix::unistd::read(&filetable, std::slice::from_mut(&mut byte))?;
453452
Ok((n > 0).then_some(byte))
454453
};
455454
while let Some(c) = read_one()? {

0 commit comments

Comments
 (0)