Skip to content

Commit 20da7d9

Browse files
authored
Print libusb error names, not numbers (#14)
1 parent e2f05b0 commit 20da7d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hwmond.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int setupUSB(libusb_device_handle **frontpanel_device_handle_ptr,
7171
libusb_device *dev = libusb_get_device(device_handle);
7272

7373
if ( (error = libusb_set_configuration(device_handle, PANEL_CONFIG)) ) {
74-
printf("Couldn't set configuration to %d: got %d", PANEL_CONFIG, error);
74+
printf("Couldn't set configuration to %d: %s", PANEL_CONFIG, libusb_error_name(error));
7575
error = 1;
7676
goto fail;
7777
}
@@ -86,7 +86,7 @@ int setupUSB(libusb_device_handle **frontpanel_device_handle_ptr,
8686
}
8787
const int interface_num = 0;
8888
if ( (error = libusb_claim_interface(device_handle, interface_num)) ) {
89-
printf("Couldn't claim interface: %d\n", error);
89+
printf("Couldn't claim interface: %s\n", libusb_error_name(error));
9090
error = 1;
9191
goto fail;
9292
}

0 commit comments

Comments
 (0)