Skip to content

Commit

Permalink
Take u32 instead of OFlags in create_lease
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ids1024 committed Nov 13, 2023
1 parent b744daf commit 47260f1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/control/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) },
Expand Down

0 comments on commit 47260f1

Please sign in to comment.