laforge has submitted this change. ( 
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(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



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;
                        }


--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/26973
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: If446bf08655739281f616df952714751fe9a3b18
Gerrit-Change-Number: 26973
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-MessageType: merged

Reply via email to