diff options
author | JP Abgrall <jpa@google.com> | 2014-05-01 23:16:12 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-05-01 23:16:12 +0000 |
commit | 585ca2a3de439751999eedb2d8ede2ce5cf59a0e (patch) | |
tree | 8de8d1d63a0ac9061f18aa4162898300ee099c76 | |
parent | 16401748204a2088aaba68e16d9b1e4d96b5c67d (diff) | |
parent | 0a90004be8aba909391b25643ba943db76660fe4 (diff) | |
download | system_core-585ca2a3de439751999eedb2d8ede2ce5cf59a0e.zip system_core-585ca2a3de439751999eedb2d8ede2ce5cf59a0e.tar.gz system_core-585ca2a3de439751999eedb2d8ede2ce5cf59a0e.tar.bz2 |
am 0a90004b: am cae898ac: am 3754791d: Merge "libusbhost: Fix issue of multiple inotify event at same time."
* commit '0a90004be8aba909391b25643ba943db76660fe4':
libusbhost: Fix issue of multiple inotify event at same time.
-rw-r--r-- | libusbhost/usbhost.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libusbhost/usbhost.c b/libusbhost/usbhost.c index ab1b856..488dd0e 100644 --- a/libusbhost/usbhost.c +++ b/libusbhost/usbhost.c @@ -263,11 +263,12 @@ int usb_host_read_event(struct usb_host_context *context) D("%s subdirectory %s: index: %d\n", (event->mask & IN_CREATE) ? "new" : "gone", path, i); if (i > 0 && i < MAX_USBFS_WD_COUNT) { + int local_ret = 0; if (event->mask & IN_CREATE) { - ret = inotify_add_watch(context->fd, path, + local_ret = inotify_add_watch(context->fd, path, IN_CREATE | IN_DELETE); - if (ret >= 0) - context->wds[i] = ret; + if (local_ret >= 0) + context->wds[i] = local_ret; done = find_existing_devices_bus(path, context->cb_added, context->data); } else if (event->mask & IN_DELETE) { |