Skip to content

Commit

Permalink
fruity: Handle libusb failing to initialize
Browse files Browse the repository at this point in the history
Which may happen due to insufficient privileges, stripped down
environments such as containers, etc.
  • Loading branch information
oleavr committed Jul 8, 2024
1 parent 2c23afa commit 3f6b41d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/fruity/device-monitor.vala
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,8 @@ namespace Frida.Fruity {

io_cancellable.cancel ();

usb_context.interrupt_event_handler ();
if (usb_context != null)
usb_context.interrupt_event_handler ();

usb_worker.join ();
usb_worker = null;
Expand Down Expand Up @@ -787,7 +788,8 @@ namespace Frida.Fruity {
}

private void perform_usb_work () {
LibUSB.Context.init (out usb_context);
if (LibUSB.Context.init (out usb_context) != SUCCESS)
return;

AtomicUint.inc (ref pending_device_arrivals);

Expand Down

0 comments on commit 3f6b41d

Please sign in to comment.