diff options
| author | Markus Pettersson <markus.pettersson@mullvad.net> | 2025-10-19 21:59:02 +0200 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-10-19 23:43:24 +0300 |
| commit | 137b87bbe57662e88518eb8a0033b548a0313f33 (patch) | |
| tree | e5ec18d6b0aa6597ef1ba3faa9b10517767c5c0a /src | |
| parent | c8eea8ee9ddf795da8cb356599f17e2dc7cfea20 (diff) | |
| download | niri-137b87bbe57662e88518eb8a0033b548a0313f33.tar.gz niri-137b87bbe57662e88518eb8a0033b548a0313f33.tar.bz2 niri-137b87bbe57662e88518eb8a0033b548a0313f33.zip | |
Use `AsFd` to get rid of re-borrowing of zbus Power Key fd
Diffstat (limited to 'src')
| -rw-r--r-- | src/niri.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/niri.rs b/src/niri.rs index 0a7894b5..49178f3f 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -2777,8 +2777,6 @@ impl Niri { #[cfg(feature = "dbus")] pub fn inhibit_power_key(&mut self) -> anyhow::Result<()> { - use std::os::fd::{AsRawFd, BorrowedFd}; - use smithay::reexports::rustix::io::{fcntl_setfd, FdFlags}; let conn = zbus::blocking::Connection::system()?; @@ -2794,8 +2792,7 @@ impl Niri { let fd: zbus::zvariant::OwnedFd = message.body().deserialize()?; // Don't leak the fd to child processes. - let borrowed = unsafe { BorrowedFd::borrow_raw(fd.as_raw_fd()) }; - if let Err(err) = fcntl_setfd(borrowed, FdFlags::CLOEXEC) { + if let Err(err) = fcntl_setfd(&fd, FdFlags::CLOEXEC) { warn!("error setting CLOEXEC on inhibit fd: {err:?}"); }; |
