Skip to content

Commit a5cb63a

Browse files
committed
Fix bad inotify FD interface
Signed-off-by: Alex Saveau <[email protected]>
1 parent 54de396 commit a5cb63a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/fs/inotify.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
pub use crate::backend::fs::inotify::{CreateFlags, WatchFlags};
44
use crate::backend::fs::syscalls;
5-
use crate::fd::{BorrowedFd, OwnedFd};
5+
use crate::fd::{AsFd, OwnedFd};
66
use crate::io;
77

88
/// `inotify_init1(flags)`—Creates a new inotify object.
@@ -25,11 +25,11 @@ pub fn inotify_init(flags: CreateFlags) -> io::Result<OwnedFd> {
2525
/// application should keep track of this externally to avoid logic errors.
2626
#[inline]
2727
pub fn inotify_add_watch<P: crate::path::Arg>(
28-
inot: BorrowedFd<'_>,
28+
inot: impl AsFd,
2929
path: P,
3030
flags: WatchFlags,
3131
) -> io::Result<i32> {
32-
path.into_with_c_str(|path| syscalls::inotify_add_watch(inot, path, flags))
32+
path.into_with_c_str(|path| syscalls::inotify_add_watch(inot.as_fd(), path, flags))
3333
}
3434

3535
/// `inotify_rm_watch(self, wd)`—Removes a watch from this inotify.
@@ -38,6 +38,6 @@ pub fn inotify_add_watch<P: crate::path::Arg>(
3838
/// [`inotify_add_watch`] and not previously have been removed.
3939
#[doc(alias = "inotify_rm_watch")]
4040
#[inline]
41-
pub fn inotify_remove_watch(inot: BorrowedFd<'_>, wd: i32) -> io::Result<()> {
42-
syscalls::inotify_rm_watch(inot, wd)
41+
pub fn inotify_remove_watch(inot: impl AsFd, wd: i32) -> io::Result<()> {
42+
syscalls::inotify_rm_watch(inot.as_fd(), wd)
4343
}

0 commit comments

Comments
 (0)