Merge "init: keychord inotify add IN_ONLYDIR" am: c8dd6b74e6

am: 421a05dda4

Change-Id: I9f77324e6ccdf3b67e6779c0a126a3aad9c18fa4
This commit is contained in:
Mark Salyzyn 2018-05-14 09:24:52 -07:00 committed by android-build-merger
commit 9dd13fa4bb

View file

@ -276,7 +276,7 @@ void GeteventOpenDevice() {
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;