fix: use libc::c_int for file descriptor instead of nix::Fd
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
use crate::compression::CompressionType;
|
use crate::compression::CompressionType;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
use libc::c_int;
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use clap::Command;
|
use clap::Command;
|
||||||
@@ -145,11 +146,9 @@ pub fn mode_diff(
|
|||||||
fn spawn_writer_thread(
|
fn spawn_writer_thread(
|
||||||
item_path: PathBuf,
|
item_path: PathBuf,
|
||||||
compression_type: CompressionType,
|
compression_type: CompressionType,
|
||||||
fd_write: nix::unistd::Fd,
|
fd_write: c_int,
|
||||||
) -> std::thread::JoinHandle<()> {
|
) -> std::thread::JoinHandle<()> {
|
||||||
// Convert nix::unistd::Fd to raw fd
|
let pipe_writer_raw = unsafe { std::fs::File::from_raw_fd(fd_write) };
|
||||||
let raw_fd = fd_write.0;
|
|
||||||
let pipe_writer_raw = unsafe { std::fs::File::from_raw_fd(raw_fd) };
|
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
write_item_to_pipe(
|
write_item_to_pipe(
|
||||||
item_path,
|
item_path,
|
||||||
|
|||||||
Reference in New Issue
Block a user