Skip to content

Commit

Permalink
MacOS, convert the RawFd to an OwnedFd
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyCoolSlug committed Jan 19, 2025
1 parent f4b7ba1 commit 5382de1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src-tauri/src/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ use cocoa::base::{id, nil};
use cocoa::foundation::{NSData, NSString};
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::os::fd::OwnedFd;
use std::path::{Path, PathBuf};

use nix::fcntl::{open, OFlag};
use nix::sys::stat::Mode;
use nix::unistd::{mkfifo, write};
use objc::{class, msg_send, sel, sel_impl};
use tauri::{AppHandle, Config, Manager};
use tauri::{AppHandle, Config, Emitter};

use crate::SHOW_EVENT_NAME;

Expand Down Expand Up @@ -59,7 +60,7 @@ pub fn setup_si(app: AppHandle) {
let flags = OFlag::O_WRONLY | OFlag::O_NONBLOCK;

let connection = match open(&path, flags, Mode::empty()) {
Ok(f) => Some(f),
Ok(f) => Some(unsafe { OwnedFd::from_raw_fd(f) }),
Err(_) => None,
};

Expand Down

0 comments on commit 5382de1

Please sign in to comment.