summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sys/inotify.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sys/inotify.rs b/src/sys/inotify.rs
index 2398c16e..e5fe930f 100644
--- a/src/sys/inotify.rs
+++ b/src/sys/inotify.rs
@@ -32,7 +32,7 @@ use libc::{c_char, c_int};
use std::ffi::{CStr, OsStr, OsString};
use std::mem::{size_of, MaybeUninit};
use std::os::unix::ffi::OsStrExt;
-use std::os::unix::io::{AsRawFd, FromRawFd, OwnedFd, RawFd};
+use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, OwnedFd, RawFd};
use std::ptr;
libc_bitflags! {
@@ -240,3 +240,9 @@ impl FromRawFd for Inotify {
Inotify { fd: OwnedFd::from_raw_fd(fd) }
}
}
+
+impl AsFd for Inotify {
+ fn as_fd(&'_ self) -> BorrowedFd<'_> {
+ self.fd.as_fd()
+ }
+}