laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/26973 )
Change subject: host: Print strerror(errno) in case of problems opening the USB device ......................................................................
host: Print strerror(errno) in case of problems opening the USB device
Change-Id: If446bf08655739281f616df952714751fe9a3b18 --- M host/src/simtrace2-cardem-pcsc.c M host/src/simtrace2-sniff.c M host/src/simtrace2-tool.c 3 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/73/26973/1
diff --git a/host/src/simtrace2-cardem-pcsc.c b/host/src/simtrace2-cardem-pcsc.c index 2806b0f..3ec7509 100644 --- a/host/src/simtrace2-cardem-pcsc.c +++ b/host/src/simtrace2-cardem-pcsc.c @@ -561,7 +561,7 @@ 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 a4eccb2..c223008 100644 --- a/host/src/simtrace2-sniff.c +++ b/host/src/simtrace2-sniff.c @@ -472,7 +472,7 @@ 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 eb61ee2..d705796 100644 --- a/host/src/simtrace2-tool.c +++ b/host/src/simtrace2-tool.c @@ -313,7 +313,7 @@ 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; }