1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-04-19 11:24:24 +02:00

fix: crash due to clipboard fd incorrectly closed

This commit is contained in:
Jake Stanger 2024-08-04 11:47:02 +01:00
parent 6e43c7ae0c
commit fb6ae42f3b
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61

View file

@ -1,13 +1,13 @@
use super::manager::DataControlDeviceManagerState;
use crate::lock;
use nix::fcntl::OFlag;
use nix::unistd::{close, pipe2};
use nix::unistd::pipe2;
use smithay_client_toolkit::data_device_manager::data_offer::DataOfferError;
use smithay_client_toolkit::data_device_manager::ReadPipe;
use std::ops::DerefMut;
use std::os::fd::{AsFd, AsRawFd};
use std::os::fd::AsFd;
use std::sync::{Arc, Mutex};
use tracing::{trace, warn};
use tracing::trace;
use wayland_client::{Connection, Dispatch, Proxy, QueueHandle};
use wayland_protocols_wlr::data_control::v1::client::zwlr_data_control_offer_v1::{
Event, ZwlrDataControlOfferV1,
@ -178,9 +178,5 @@ pub unsafe fn receive(
offer.receive(mime_type, writefd.as_fd());
if let Err(err) = close(writefd.as_raw_fd()) {
warn!("Failed to close write pipe: {}", err);
}
Ok(ReadPipe::from(readfd))
}