Browse Source

Prevent segfault when running without root permissions, add notes

pull/11/head
surkhe 11 months ago
parent
commit
43d9f90367
  1. 3
      hanvon-libusb.c

3
hanvon-libusb.c

@ -454,7 +454,7 @@ void loop() { @@ -454,7 +454,7 @@ void loop() {
int status = 0;
int LAST_HOT_COUNT = 0;
while (1) {
if (TX != NULL) {
if (TX != NULL && TX->dev_handle != 0) {
status = libusb_submit_transfer(TX);
}
if (status < 0 && LAST_HOT_COUNT != HOT_COUNT) {
@ -466,6 +466,7 @@ void loop() { @@ -466,6 +466,7 @@ void loop() {
}
}
// TODO: make scuti explain why this is called twice
int hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev,
libusb_hotplug_event event, void *user_data) {

Loading…
Cancel
Save