summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2014-05-01 23:12:03 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-01 23:12:03 +0000
commit0a90004be8aba909391b25643ba943db76660fe4 (patch)
treeda14fc870260dc4b8fbd8217b7509b7f838c4478
parent53d29ed155c0db7110f5d610d012b9b94d325ed7 (diff)
parentcae898acba04beec2d3d702ba38a940995f98d28 (diff)
downloadsystem_core-0a90004be8aba909391b25643ba943db76660fe4.zip
system_core-0a90004be8aba909391b25643ba943db76660fe4.tar.gz
system_core-0a90004be8aba909391b25643ba943db76660fe4.tar.bz2
am cae898ac: am 3754791d: Merge "libusbhost: Fix issue of multiple inotify event at same time."
* commit 'cae898acba04beec2d3d702ba38a940995f98d28': libusbhost: Fix issue of multiple inotify event at same time.
-rw-r--r--libusbhost/usbhost.c7
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) {