mux: fix setsockopt invocation for NetBSD
refs: https://github.com/wezterm/wezterm/issues/6665
This commit is contained in:
1 file changed
+4
-3
+4
-3
@@ -9,7 +9,7 @@ use config::{configuration, ExitBehavior, GuiPosition};
|
||||
use domain::{Domain, DomainId, DomainState, SplitSource};
|
||||
use filedescriptor::{poll, pollfd, socketpair, AsRawSocketDescriptor, FileDescriptor, POLLIN};
|
||||
#[cfg(unix)]
|
||||
use libc::{SOL_SOCKET, SO_RCVBUF, SO_SNDBUF};
|
||||
use libc::{c_int, SOL_SOCKET, SO_RCVBUF, SO_SNDBUF};
|
||||
use log::error;
|
||||
use metrics::histogram;
|
||||
use parking_lot::{
|
||||
@@ -29,7 +29,7 @@ use termwiz::escape::{Action, CSI};
|
||||
use thiserror::*;
|
||||
use wezterm_term::{Clipboard, ClipboardSelection, DownloadHandler, TerminalSize};
|
||||
#[cfg(windows)]
|
||||
use winapi::um::winsock2::{SOL_SOCKET, SO_RCVBUF, SO_SNDBUF};
|
||||
use winapi::um::winsock2::{std::os::raw::c_int, SOL_SOCKET, SO_RCVBUF, SO_SNDBUF};
|
||||
|
||||
pub mod activity;
|
||||
pub mod client;
|
||||
@@ -241,13 +241,14 @@ fn parse_buffered_data(pane: Weak<dyn Pane>, dead: &Arc<AtomicBool>, mut rx: Fil
|
||||
}
|
||||
|
||||
fn set_socket_buffer(fd: &mut FileDescriptor, option: i32, size: usize) -> anyhow::Result<()> {
|
||||
let size = size as c_int;
|
||||
let socklen = std::mem::size_of_val(&size);
|
||||
unsafe {
|
||||
let res = libc::setsockopt(
|
||||
fd.as_socket_descriptor(),
|
||||
SOL_SOCKET,
|
||||
option,
|
||||
&size as *const usize as *const _,
|
||||
&size as *const c_int as *const _,
|
||||
socklen as _,
|
||||
);
|
||||
if res == 0 {
|
||||
|
||||
Reference in new issue
Block a user