Merge "init: keychord inotify add IN_ONLYDIR"
am: c8dd6b74e6
Change-Id: I876090858fd38c16456a93d5da196b8cf57975b1
diff --git a/init/keychords.cpp b/init/keychords.cpp
index 10c56e3..293736d 100644
--- a/init/keychords.cpp
+++ b/init/keychords.cpp
@@ -276,7 +276,7 @@
inotify_fd = ::inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
if (inotify_fd < 0) {
PLOG(WARNING) << "Could not instantiate inotify for " << kDevicePath;
- } else if (::inotify_add_watch(inotify_fd, kDevicePath, IN_DELETE | IN_CREATE) < 0) {
+ } else if (::inotify_add_watch(inotify_fd, kDevicePath, IN_DELETE | IN_CREATE | IN_ONLYDIR) < 0) {
PLOG(WARNING) << "Could not add watch for " << kDevicePath;
::close(inotify_fd);
inotify_fd = -1;