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.
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 @@
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) {