fix: use libc::c_int for file descriptor instead of nix::Fd

This commit is contained in:
Andrew Phillips (aider)
2025-05-12 11:16:46 -03:00
parent 723ec2a6e8
commit f9969a7537

View File

@@ -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,