From 3f0d92f282b62bc99d578f73b163359b868d323c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 25 Jan 2022 16:09:14 +0100 Subject: [PATCH] host: Print strerror(errno) in case of problems opening the USB device Change-Id: If446bf08655739281f616df952714751fe9a3b18 --- host/src/simtrace2-cardem-pcsc.c | 2 +- host/src/simtrace2-sniff.c | 2 +- host/src/simtrace2-tool.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/host/src/simtrace2-cardem-pcsc.c b/host/src/simtrace2-cardem-pcsc.c index 2806b0f7..3ec75098 100644 --- a/host/src/simtrace2-cardem-pcsc.c +++ b/host/src/simtrace2-cardem-pcsc.c @@ -561,7 +561,7 @@ int main(int argc, char **argv) transp->usb_async = true; transp->usb_devh = osmo_libusb_open_claim_interface(NULL, NULL, ifm); if (!transp->usb_devh) { - fprintf(stderr, "can't open USB device\n"); + fprintf(stderr, "can't open USB device: %s\n", strerror(errno)); goto close; } diff --git a/host/src/simtrace2-sniff.c b/host/src/simtrace2-sniff.c index a4eccb21..c2230081 100644 --- a/host/src/simtrace2-sniff.c +++ b/host/src/simtrace2-sniff.c @@ -472,7 +472,7 @@ int main(int argc, char **argv) do { _transp.usb_devh = osmo_libusb_open_claim_interface(NULL, NULL, &ifm_selected); if (!_transp.usb_devh) { - fprintf(stderr, "can't open USB device\n"); + fprintf(stderr, "can't open USB device: %s\n", strerror(errno)); goto close_exit; } diff --git a/host/src/simtrace2-tool.c b/host/src/simtrace2-tool.c index eb61ee22..d7057967 100644 --- a/host/src/simtrace2-tool.c +++ b/host/src/simtrace2-tool.c @@ -313,7 +313,7 @@ int main(int argc, char **argv) osmo_strlcpy(ifm->path, path, sizeof(ifm->path)); transp->usb_devh = osmo_libusb_open_claim_interface(NULL, NULL, ifm); if (!transp->usb_devh) { - fprintf(stderr, "can't open USB device\n"); + fprintf(stderr, "can't open USB device: %s\n", strerror(errno)); goto close_exit; }