- if (!(pfd = libusb_get_pollfds(drvc->sr_ctx->libusb_ctx))) {
- sr_err("libusb_get_pollfds failed.");
- return SR_ERR;
- }
-
- /* Count the number of file descriptors. */
- for (devc->num_usbfd = 0; pfd[devc->num_usbfd]; devc->num_usbfd++);
-
- if (!(devc->usbfd = g_try_malloc(devc->num_usbfd * sizeof(int)))) {
- sr_err("File descriptor array malloc failed.");
- free(pfd);
- return SR_ERR_MALLOC;
- }
-