From 47260f101102d025de460cc89322eb2346bea55d Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 13 Nov 2023 15:20:08 -0800 Subject: [PATCH] Take `u32` instead of `OFlags` in `create_lease` This shouldn't be too much worse to use, and avoids any kind of public dependency of Rustix. So a new version of it won't be a breaking change. --- src/control/mod.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/control/mod.rs b/src/control/mod.rs index aafcc6d..2b6f946 100644 --- a/src/control/mod.rs +++ b/src/control/mod.rs @@ -63,8 +63,6 @@ use std::time::Duration; use core::num::NonZeroU32; -pub use rustix::fs::OFlags; - /// Raw handle for a drm resource pub type RawResourceHandle = NonZeroU32; @@ -958,13 +956,9 @@ pub trait Device: super::Device { fn create_lease( &self, objects: &[RawResourceHandle], - flags: OFlags, + flags: u32, ) -> io::Result<(LeaseId, OwnedFd)> { - let lease = ffi::mode::create_lease( - self.as_fd(), - bytemuck::cast_slice(objects), - flags.bits() as u32, - )?; + let lease = ffi::mode::create_lease(self.as_fd(), bytemuck::cast_slice(objects), flags)?; Ok(( unsafe { NonZeroU32::new_unchecked(lease.lessee_id) }, unsafe { OwnedFd::from_raw_fd(lease.fd as RawFd) },