diff --git a/src/inotify/mod.rs b/src/inotify/mod.rs index 239c4f14..f8161f60 100644 --- a/src/inotify/mod.rs +++ b/src/inotify/mod.rs @@ -33,10 +33,12 @@ impl INotifyWatcher { Err(e) => { match e.kind { IoErrorKind::EndOfFile => break, - _ => tx.send(Event { - path: None, - op: Err(Error::Io(e)) - }) + _ => { + let _ = tx.send_opt(Event { + path: None, + op: Err(Error::Io(e)) + }); + } } } } @@ -91,7 +93,7 @@ impl Watcher for INotifyWatcher { }, Err(e) => return Err(Error::Io(e)) }; - + it.run(); return Ok(it); } diff --git a/src/lib.rs b/src/lib.rs index 4f59bbd2..58830fe0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,12 +23,13 @@ pub mod op { } } -#[deriving(Send)] pub struct Event { pub path: Option, pub op: Result, } +unsafe impl Send for Event {} + pub enum Error { Generic(String), Io(IoError), @@ -53,7 +54,7 @@ pub fn new(tx: Sender) -> Result { #[test] #[cfg(target_os = "linux")] fn new_inotify() { - let (tx, rx) = channel(); + let (tx, _) = channel(); let w: Result = Watcher::new(tx); match w { Ok(_) => assert!(true), @@ -63,7 +64,7 @@ fn new_inotify() { #[test] fn new_poll() { - let (tx, rx) = channel(); + let (tx, _) = channel(); let w: Result = Watcher::new(tx); match w { Ok(_) => assert!(true), @@ -73,10 +74,10 @@ fn new_poll() { #[test] fn new_recommended() { - let (tx, rx) = channel(); + let (tx, _) = channel(); let w: Result = Watcher::new(tx); match w { Ok(_) => assert!(true), Err(_) => assert!(false) } -} \ No newline at end of file +}