mirror of
https://github.com/htrefil/rkvm.git
synced 2024-12-26 09:58:32 +01:00
Use new inotify APIs
This commit is contained in:
parent
9e9b74d768
commit
347dafeae7
1 changed files with 3 additions and 3 deletions
|
@ -37,12 +37,12 @@ async fn monitor(sender: Sender<Result<Interceptor, Error>>) {
|
||||||
|
|
||||||
let mut read_dir = fs::read_dir(EVENT_PATH).await?;
|
let mut read_dir = fs::read_dir(EVENT_PATH).await?;
|
||||||
|
|
||||||
let mut inotify = Inotify::init()?;
|
let inotify = Inotify::init()?;
|
||||||
inotify.add_watch(EVENT_PATH, WatchMask::CREATE)?;
|
inotify.watches().add(EVENT_PATH, WatchMask::CREATE)?;
|
||||||
|
|
||||||
// This buffer size should be OK, since we don't expect a lot of devices
|
// This buffer size should be OK, since we don't expect a lot of devices
|
||||||
// to be plugged in frequently.
|
// to be plugged in frequently.
|
||||||
let mut stream = inotify.event_stream([0; 512])?;
|
let mut stream = inotify.into_event_stream([0; 512])?;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let path = match read_dir.next_entry().await? {
|
let path = match read_dir.next_entry().await? {
|
||||||
|
|
Loading…
Reference in a new issue