1
0
Fork 0
forked from wry/wry

utils: add pipe util

This commit is contained in:
Julian Orth 2026-02-24 14:03:55 +01:00
parent 05476d68f3
commit 73451550ba
9 changed files with 107 additions and 30 deletions

View file

@ -6,7 +6,10 @@ use {
test_transport::TestTransport,
testrun::ParseFull,
},
utils::buffd::MsgParser,
utils::{
buffd::MsgParser,
pipe::{Pipe, pipe},
},
wire::{ZwlrDataControlOfferV1Id, zwlr_data_control_offer_v1::*},
},
ahash::AHashSet,
@ -14,7 +17,7 @@ use {
cell::{Cell, RefCell},
rc::Rc,
},
uapi::{OwnedFd, c},
uapi::OwnedFd,
};
pub struct TestDataControlOffer {
@ -33,7 +36,7 @@ impl TestDataControlOffer {
}
pub fn receive(&self, mime_type: &str) -> TestResult<Rc<OwnedFd>> {
let (read, write) = uapi::pipe2(c::O_CLOEXEC)?;
let Pipe { read, write } = pipe()?;
self.tran.send(Receive {
self_id: self.id,
mime_type,