Lines Matching refs:context
128 static void watch_existing_subdirs(struct usb_host_context *context,
134 wds[0] = inotify_add_watch(context->fd, USB_FS_DIR, IN_CREATE | IN_DELETE);
141 ret = inotify_add_watch(context->fd, path, IN_CREATE | IN_DELETE);
149 struct usb_host_context *context = calloc(1, sizeof(struct usb_host_context));
150 if (!context) {
154 context->fd = inotify_init();
155 if (context->fd < 0) {
157 free(context);
160 return context;
163 void usb_host_cleanup(struct usb_host_context *context)
165 close(context->fd);
166 free(context);
169 void usb_host_run(struct usb_host_context *context,
189 wdd = inotify_add_watch(context->fd, DEV_DIR, IN_CREATE | IN_DELETE);
197 watch_existing_subdirs(context, wds, wd_count);
205 ret = read(context->fd, event_buf, sizeof(event_buf));
211 watch_existing_subdirs(context, wds, wd_count);
216 inotify_rm_watch(context->fd, wds[i]);
228 ret = inotify_add_watch(context->fd, path,
235 inotify_rm_watch(context->fd, wds[i]);