mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-23 16:18:12 +08:00
Fix unused import when pipe2 isn't available
This commit is contained in:
parent
99bd2e71d0
commit
f16c132f3c
@ -7,8 +7,7 @@ use crate::wchar::prelude::*;
|
|||||||
use crate::wutil::perror;
|
use crate::wutil::perror;
|
||||||
use errno::{errno, set_errno};
|
use errno::{errno, set_errno};
|
||||||
use libc::{
|
use libc::{
|
||||||
c_int, EINTR, FD_CLOEXEC, F_DUPFD_CLOEXEC, F_GETFD, F_GETFL, F_SETFD, F_SETFL, O_CLOEXEC,
|
c_int, EINTR, FD_CLOEXEC, F_DUPFD_CLOEXEC, F_GETFD, F_GETFL, F_SETFD, F_SETFL, O_NONBLOCK,
|
||||||
O_NONBLOCK,
|
|
||||||
};
|
};
|
||||||
use nix::{fcntl::OFlag, unistd};
|
use nix::{fcntl::OFlag, unistd};
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
@ -139,7 +138,7 @@ pub fn make_autoclose_pipes() -> Option<AutoClosePipes> {
|
|||||||
let mut already_cloexec = false;
|
let mut already_cloexec = false;
|
||||||
#[cfg(HAVE_PIPE2)]
|
#[cfg(HAVE_PIPE2)]
|
||||||
{
|
{
|
||||||
if unsafe { libc::pipe2(&mut pipes[0], O_CLOEXEC) } < 0 {
|
if unsafe { libc::pipe2(&mut pipes[0], libc::O_CLOEXEC) } < 0 {
|
||||||
FLOG!(warning, PIPE_ERROR);
|
FLOG!(warning, PIPE_ERROR);
|
||||||
perror("pipe2");
|
perror("pipe2");
|
||||||
return None;
|
return None;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user