Reset the watch key after processing events. watckKey -> watchKey

This commit is contained in:
Cameron Gutman
2015-02-19 19:38:08 -05:00
parent 7f580a9cc0
commit 5b20f16d44

View File

@@ -91,8 +91,8 @@ public class EvdevLoader implements Runnable {
evdev.register(watcher, StandardWatchEventKinds.ENTRY_CREATE);
for (;;) {
WatchKey watckKey = watcher.take();
List<WatchEvent<?>> events = watckKey.pollEvents();
WatchKey watchKey = watcher.take();
List<WatchEvent<?>> events = watchKey.pollEvents();
for (WatchEvent event:events) {
if (event.kind() == StandardWatchEventKinds.ENTRY_CREATE) {
String name = event.context().toString();
@@ -102,6 +102,10 @@ public class EvdevLoader implements Runnable {
}
}
}
if (!watchKey.reset()) {
break;
}
}
} catch (IOException | InterruptedException ex) {
LimeLog.severe(ex.getMessage());