From: Benjamin M. <bm...@WP...> - 2006-07-31 01:36:14
|
Hi everybody, I found a couple of minor problems with the SilverLink/DUSB on Linux in libticables2 0.1.2, which occur when there is an error trying to read data from the cable. First, the error message says 'usb_bulk_write' rather than 'usb_bulk_read'. Yes, I know it doesn't actually use usb_bulk_read on Linux, but it's a close approximation. :) More importantly, slv_get() doesn't stop when an error occurs, and it always returns 0. Patch: --- linux/link_slv.c~ 2006-07-03 07:10:11.000000000 -0400 +++ linux/link_slv.c 2006-07-30 16:32:30.000000000 -0400 @@ -673,19 +673,19 @@ if(ret == -ETIMEDOUT) { - ticables_warning("usb_bulk_write (%s).\n", usb_strerror()); + ticables_warning("usb_bulk_read (%s).\n", usb_strerror()); nBytesRead = 0; return ERR_READ_TIMEOUT; } else if(ret == -EPIPE) { - ticables_warning("usb_bulk_write (%s).\n", usb_strerror()); + ticables_warning("usb_bulk_read (%s).\n", usb_strerror()); nBytesRead = 0; return ERR_READ_ERROR; } else if(ret < 0) { - ticables_warning("usb_bulk_write (%s).\n", usb_strerror()); + ticables_warning("usb_bulk_read (%s).\n", usb_strerror()); nBytesRead = 0; return ERR_READ_ERROR; } @@ -707,7 +707,7 @@ // we can't do that in any other way because slv_get_ can returns // 1, 2, ..., len bytes. for(i = 0; i < len; i++) - slv_get_(h, data+i); + TRYC(slv_get_(h, data+i)); return 0; } Benjamin Moody |