mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
Use osmo_libusb_{init,exit}() instead of libusb_{init,exit}()
We use other osmo_libusb_* functions later in the code, so it is best to initialize the library via libosmousb, and not directly. Change-Id: I2fd981935e1420e529f5dd8a98edd347c317284c
This commit is contained in:
@@ -633,7 +633,7 @@ close_exit:
|
|||||||
if (transp->usb_devh)
|
if (transp->usb_devh)
|
||||||
libusb_close(transp->usb_devh);
|
libusb_close(transp->usb_devh);
|
||||||
|
|
||||||
libusb_exit(NULL);
|
osmo_libusb_exit(NULL);
|
||||||
do_exit:
|
do_exit:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Scan for available SIMtrace USB devices supporting sniffing */
|
/* Scan for available SIMtrace USB devices supporting sniffing */
|
||||||
rc = libusb_init(NULL);
|
rc = osmo_libusb_init(NULL);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
fprintf(stderr, "libusb initialization failed\n");
|
fprintf(stderr, "libusb initialization failed\n");
|
||||||
goto do_exit;
|
goto do_exit;
|
||||||
@@ -505,7 +505,7 @@ close_exit:
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
} while (keep_running);
|
} while (keep_running);
|
||||||
|
|
||||||
libusb_exit(NULL);
|
osmo_libusb_exit(NULL);
|
||||||
do_exit:
|
do_exit:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
transp->udp_fd = -1;
|
transp->udp_fd = -1;
|
||||||
|
|
||||||
rc = libusb_init(NULL);
|
rc = osmo_libusb_init(NULL);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
fprintf(stderr, "libusb initialization failed\n");
|
fprintf(stderr, "libusb initialization failed\n");
|
||||||
goto do_exit;
|
goto do_exit;
|
||||||
@@ -326,7 +326,7 @@ close_exit:
|
|||||||
libusb_close(transp->usb_devh);
|
libusb_close(transp->usb_devh);
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
libusb_exit(NULL);
|
osmo_libusb_exit(NULL);
|
||||||
do_exit:
|
do_exit:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ static int find_devices(void)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
libusb_init(NULL);
|
osmo_libusb_init(NULL);
|
||||||
find_devices();
|
find_devices();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user