aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tty.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-10-24 15:05:14 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-10-24 15:05:14 +0400
commit3fd421f13fb823a5dd2b75d0d8649d190f932b2d (patch)
tree3ebf940c92c11153f1f28e3c313d972c7aa1e3f1 /src/backend/tty.rs
parentd25473188528b9e9b69e2fb70dccaf8c3605128d (diff)
downloadniri-3fd421f13fb823a5dd2b75d0d8649d190f932b2d.tar.gz
niri-3fd421f13fb823a5dd2b75d0d8649d190f932b2d.tar.bz2
niri-3fd421f13fb823a5dd2b75d0d8649d190f932b2d.zip
Update Smithay
Diffstat (limited to 'src/backend/tty.rs')
-rw-r--r--src/backend/tty.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs
index 1da682d8..2f2e7a90 100644
--- a/src/backend/tty.rs
+++ b/src/backend/tty.rs
@@ -1,13 +1,13 @@
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::mem;
-use std::os::fd::FromRawFd;
use std::path::{Path, PathBuf};
use std::rc::Rc;
use std::sync::{Arc, Mutex};
use std::time::Duration;
use anyhow::{anyhow, Context};
+use libc::dev_t;
use smithay::backend::allocator::dmabuf::Dmabuf;
use smithay::backend::allocator::gbm::{GbmAllocator, GbmBufferFlags, GbmDevice};
use smithay::backend::allocator::{Format as DrmFormat, Fourcc};
@@ -29,8 +29,7 @@ use smithay::reexports::drm::control::{
connector, crtc, Mode as DrmMode, ModeFlags, ModeTypeFlags, Device, property,
};
use smithay::reexports::input::Libinput;
-use smithay::reexports::nix::fcntl::OFlag;
-use smithay::reexports::nix::libc::dev_t;
+use smithay::reexports::rustix::fs::OFlags;
use smithay::reexports::wayland_protocols::wp::linux_dmabuf::zv1::server::zwp_linux_dmabuf_feedback_v1::TrancheFlags;
use smithay::reexports::wayland_protocols::wp::presentation_time::server::wp_presentation_feedback;
use smithay::utils::DeviceFd;
@@ -285,9 +284,9 @@ impl Tty {
debug!("adding device {path:?}");
assert!(self.output_device.is_none());
- let open_flags = OFlag::O_RDWR | OFlag::O_CLOEXEC | OFlag::O_NOCTTY | OFlag::O_NONBLOCK;
+ let open_flags = OFlags::RDWR | OFlags::CLOEXEC | OFlags::NOCTTY | OFlags::NONBLOCK;
let fd = self.session.open(path, open_flags)?;
- let device_fd = unsafe { DrmDeviceFd::new(DeviceFd::from_raw_fd(fd)) };
+ let device_fd = DrmDeviceFd::new(DeviceFd::from(fd));
let (drm, drm_notifier) = DrmDevice::new(device_fd.clone(), true)?;
let gbm = GbmDevice::new(device_fd)?;