Skip to content

Commit

Permalink
Fix bad inotify FD interface
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <[email protected]>
  • Loading branch information
SUPERCILEX committed Aug 15, 2024
1 parent 3c519a9 commit 97b971f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/fs/inotify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pub use crate::backend::fs::inotify::{CreateFlags, WatchFlags};
use crate::backend::fs::syscalls;
use crate::fd::{BorrowedFd, OwnedFd};
use crate::fd::{AsFd, OwnedFd};
use crate::io;

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

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

0 comments on commit 97b971f

Please sign in to comment.