mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-21 23:11:17 -03:00
Update nix to 0.30.1 (#11458)
After nix updated to 0.30, all functions related to file descriptor accepts impl AsFd, e.g., BorrowedFd. This PR is a minimal update. It tries to use impl AsFd as long as possible, but uses BorrowedFd in some places. Yes it introduces unsafe, but doesn't introduce new unsafe code.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
use std::num::NonZeroUsize;
|
||||
use std::ops::ControlFlow;
|
||||
use std::ops::Range;
|
||||
use std::os::fd::BorrowedFd;
|
||||
use std::os::fd::RawFd;
|
||||
use std::pin::Pin;
|
||||
use std::rc::Rc;
|
||||
@@ -797,7 +798,7 @@ fn read_ni(parser: &Parser, fd: RawFd, io: &IoChain) -> Result<(), ErrorCode> {
|
||||
loop {
|
||||
let mut buff = [0_u8; 4096];
|
||||
|
||||
match nix::unistd::read(fd, &mut buff) {
|
||||
match nix::unistd::read(unsafe { BorrowedFd::borrow_raw(fd) }, &mut buff) {
|
||||
Ok(0) => {
|
||||
// EOF.
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user