Skip to content

Commit

Permalink
drivers/*usb.c: address fallout for LIBUSB_ERROR_* renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
jimklimov committed Jun 14, 2022
1 parent 30a933f commit 09ee672
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions drivers/blazer_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static int ippon_command(const char *cmd, char *buf, size_t buflen)
0x09, 0x2, 0, (usb_ctrl_charbuf)&tmp[i], 8, 1000);

if (ret <= 0) {
upsdebugx(3, "send: %s", (ret != ERROR_TIMEOUT) ? nut_usb_strerror(ret) : "Connection timed out");
upsdebugx(3, "send: %s", (ret != LIBUSB_ERROR_TIMEOUT) ? nut_usb_strerror(ret) : "Connection timed out");
return ret;
}
}
Expand All @@ -224,7 +224,7 @@ static int ippon_command(const char *cmd, char *buf, size_t buflen)
* will happen after successfully writing a command to the UPS)
*/
if (ret <= 0) {
upsdebugx(3, "read: %s", (ret != ERROR_TIMEOUT) ? nut_usb_strerror(ret) : "Connection timed out");
upsdebugx(3, "read: %s", (ret != LIBUSB_ERROR_TIMEOUT) ? nut_usb_strerror(ret) : "Connection timed out");
return ret;
}

Expand Down
6 changes: 3 additions & 3 deletions drivers/nutdrv_qx.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ static int sgs_command(const char *cmd, char *buf, size_t buflen)

/* No error!!! */
/* if (ret == -110) */
if (ret == ERROR_TIMEOUT)
if (ret == LIBUSB_ERROR_TIMEOUT)
break;

/* Any errors here mean that we are unable to read a reply
Expand Down Expand Up @@ -769,7 +769,7 @@ static int ippon_command(const char *cmd, char *buf, size_t buflen)

if (ret <= 0) {
upsdebugx(3, "send: %s (%d)",
(ret != ERROR_TIMEOUT) ? nut_usb_strerror(ret) : "Connection timed out",
(ret != LIBUSB_ERROR_TIMEOUT) ? nut_usb_strerror(ret) : "Connection timed out",
ret);
return ret;
}
Expand All @@ -788,7 +788,7 @@ static int ippon_command(const char *cmd, char *buf, size_t buflen)
* to the UPS) */
if (ret <= 0) {
upsdebugx(3, "read: %s (%d)",
(ret != ERROR_TIMEOUT) ? nut_usb_strerror(ret) : "Connection timed out",
(ret != LIBUSB_ERROR_TIMEOUT) ? nut_usb_strerror(ret) : "Connection timed out",
ret);
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/tripplite_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ static void usb_comm_fail(int res, const char *msg)
static int try = 0;

switch(res) {
case ERROR_BUSY:
case LIBUSB_ERROR_BUSY:
upslogx(LOG_WARNING,
"%s: Device claimed by another process", msg);
fatalx(EXIT_FAILURE, "Terminating: EBUSY");
Expand Down

0 comments on commit 09ee672

Please sign in to comment.