Use libusb_error_name() more often for better diagnostics.

This commit is contained in:
Uwe Hermann 2016-01-29 18:00:11 +01:00
parent 9dfacd8706
commit eb8e6cd2cb
2 changed files with 6 additions and 4 deletions

View File

@ -774,8 +774,8 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
sdi = transfer->user_data;
devc = sdi->priv;
sr_spew("receive_transfer(): status %d received %d bytes.",
transfer->status, transfer->actual_length);
sr_spew("receive_transfer(): status %s received %d bytes.",
libusb_error_name(transfer->status), transfer->actual_length);
if (transfer->actual_length == 0)
/* Nothing to send to the bus. */

View File

@ -270,7 +270,8 @@ SR_PRIV void LIBUSB_CALL sl2_receive_transfer_in( struct libusb_transfer *transf
devc = sdi->priv;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
sr_err("Transfer to device failed: %i.", transfer->status);
sr_err("Transfer to device failed: %s.",
libusb_error_name(transfer->status));
devc->transfer_error = TRUE;
return;
}
@ -400,7 +401,8 @@ SR_PRIV void LIBUSB_CALL sl2_receive_transfer_out( struct libusb_transfer *trans
devc = sdi->priv;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
sr_err("Transfer to device failed: %i.", transfer->status);
sr_err("Transfer to device failed: %s.",
libusb_error_name(transfer->status));
devc->transfer_error = TRUE;
return;
}