summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Abgrall2014-05-01 18:16:12 -0500
committerAndroid Git Automerger2014-05-01 18:16:12 -0500
commit585ca2a3de439751999eedb2d8ede2ce5cf59a0e (patch)
tree8de8d1d63a0ac9061f18aa4162898300ee099c76 /libusbhost/usbhost.c
parent16401748204a2088aaba68e16d9b1e4d96b5c67d (diff)
parent0a90004be8aba909391b25643ba943db76660fe4 (diff)
downloadplatform-system-core-585ca2a3de439751999eedb2d8ede2ce5cf59a0e.tar.gz
platform-system-core-585ca2a3de439751999eedb2d8ede2ce5cf59a0e.tar.xz
platform-system-core-585ca2a3de439751999eedb2d8ede2ce5cf59a0e.zip
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.
Diffstat (limited to 'libusbhost/usbhost.c')
-rw-r--r--libusbhost/usbhost.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libusbhost/usbhost.c b/libusbhost/usbhost.c
index ab1b8566c..488dd0e67 100644
--- a/libusbhost/usbhost.c
+++ b/libusbhost/usbhost.c
@@ -263,11 +263,12 @@ int usb_host_read_event(struct usb_host_context *context)
263 D("%s subdirectory %s: index: %d\n", (event->mask & IN_CREATE) ? 263 D("%s subdirectory %s: index: %d\n", (event->mask & IN_CREATE) ?
264 "new" : "gone", path, i); 264 "new" : "gone", path, i);
265 if (i > 0 && i < MAX_USBFS_WD_COUNT) { 265 if (i > 0 && i < MAX_USBFS_WD_COUNT) {
266 int local_ret = 0;
266 if (event->mask & IN_CREATE) { 267 if (event->mask & IN_CREATE) {
267 ret = inotify_add_watch(context->fd, path, 268 local_ret = inotify_add_watch(context->fd, path,
268 IN_CREATE | IN_DELETE); 269 IN_CREATE | IN_DELETE);
269 if (ret >= 0) 270 if (local_ret >= 0)
270 context->wds[i] = ret; 271 context->wds[i] = local_ret;
271 done = find_existing_devices_bus(path, context->cb_added, 272 done = find_existing_devices_bus(path, context->cb_added,
272 context->data); 273 context->data);
273 } else if (event->mask & IN_DELETE) { 274 } else if (event->mask & IN_DELETE) {