diff options
| author | JP Abgrall <jpa@google.com> | 2014-05-01 23:09:17 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-05-01 23:09:17 +0000 |
| commit | cae898acba04beec2d3d702ba38a940995f98d28 (patch) | |
| tree | 9736df91be0cb6db76faf5ceb31e88509f4f8bd3 | |
| parent | 2293904c2c1331735534eab11a903bd2cd0d1d2c (diff) | |
| parent | 3754791dd5415c2e99d3bfd6599d414a202cbfc3 (diff) | |
| download | system_core-cae898acba04beec2d3d702ba38a940995f98d28.zip system_core-cae898acba04beec2d3d702ba38a940995f98d28.tar.gz system_core-cae898acba04beec2d3d702ba38a940995f98d28.tar.bz2 | |
am 3754791d: Merge "libusbhost: Fix issue of multiple inotify event at same time."
* commit '3754791dd5415c2e99d3bfd6599d414a202cbfc3':
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 8be393e..cd8000a 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) { |
