Skip to content

Commit

Permalink
fix: crash due to clipboard fd incorrectly closed
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeStanger committed Aug 4, 2024
1 parent 6e43c7a commit fb6ae42
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/clients/wayland/wlr_data_control/offer.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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))
}

0 comments on commit fb6ae42

Please sign in to comment.