Skip to content

Commit

Permalink
Map USBSUP_XFER_DNR to EPIPE instead of ETIME
Browse files Browse the repository at this point in the history
  • Loading branch information
dorssel committed Dec 23, 2023
1 parent 2d82098 commit 972d742
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion UnitTests/Tools_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ sealed class ErrorData
{
{ UsbSupError.USBSUP_XFER_OK, Errno.SUCCESS },
{ UsbSupError.USBSUP_XFER_STALL, Errno.EPIPE },
{ UsbSupError.USBSUP_XFER_DNR, Errno.ETIME },
// HACK: see https://github.com/dorssel/usbipd-win/issues/807

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
// { UsbSupError.USBSUP_XFER_DNR, Errno.ETIME },
{ UsbSupError.USBSUP_XFER_DNR, Errno.EPIPE },
{ UsbSupError.USBSUP_XFER_CRC, Errno.EILSEQ },
{ UsbSupError.USBSUP_XFER_NAC, Errno.EPROTO },
{ UsbSupError.USBSUP_XFER_UNDERRUN, Errno.EREMOTEIO },
Expand Down
4 changes: 3 additions & 1 deletion Usbipd/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ public static Errno ConvertError(UsbSupError usbSupError)
{
UsbSupError.USBSUP_XFER_OK => Errno.SUCCESS,
UsbSupError.USBSUP_XFER_STALL => Errno.EPIPE,
UsbSupError.USBSUP_XFER_DNR => Errno.ETIME,
// HACK: see https://github.com/dorssel/usbipd-win/issues/807

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
// UsbSupError.USBSUP_XFER_DNR => Errno.ETIME,
UsbSupError.USBSUP_XFER_DNR => Errno.EPIPE,
UsbSupError.USBSUP_XFER_CRC => Errno.EILSEQ,
UsbSupError.USBSUP_XFER_NAC => Errno.EPROTO,
UsbSupError.USBSUP_XFER_UNDERRUN => Errno.EREMOTEIO,
Expand Down

0 comments on commit 972d742

Please sign in to comment.