Loading libusbhost/usbhost.c +44 −39 Original line number Diff line number Diff line Loading @@ -223,12 +223,14 @@ int usb_host_read_event(struct usb_host_context *context) char event_buf[512]; char path[100]; int i, ret, done = 0; int j, event_size; int offset = 0; int wd; ret = read(context->fd, event_buf, sizeof(event_buf)); if (ret >= (int)sizeof(struct inotify_event)) { event = (struct inotify_event *)event_buf; while (offset < ret) { event = (struct inotify_event*)&event_buf[offset]; done = 0; wd = event->wd; if (wd == context->wdd) { if ((event->mask & IN_CREATE) && !strcmp(event->name, "bus")) { Loading Loading @@ -274,6 +276,9 @@ int usb_host_read_event(struct usb_host_context *context) } } } offset += sizeof(struct inotify_event) + event->len; } } return done; Loading Loading
libusbhost/usbhost.c +44 −39 Original line number Diff line number Diff line Loading @@ -223,12 +223,14 @@ int usb_host_read_event(struct usb_host_context *context) char event_buf[512]; char path[100]; int i, ret, done = 0; int j, event_size; int offset = 0; int wd; ret = read(context->fd, event_buf, sizeof(event_buf)); if (ret >= (int)sizeof(struct inotify_event)) { event = (struct inotify_event *)event_buf; while (offset < ret) { event = (struct inotify_event*)&event_buf[offset]; done = 0; wd = event->wd; if (wd == context->wdd) { if ((event->mask & IN_CREATE) && !strcmp(event->name, "bus")) { Loading Loading @@ -274,6 +276,9 @@ int usb_host_read_event(struct usb_host_context *context) } } } offset += sizeof(struct inotify_event) + event->len; } } return done; Loading