[Nut-upsdev] ETIME on FreeBSD

Arjen de Korte nut+devel at de-korte.org
Sun Jan 17 18:51:53 UTC 2010


Citeren Charles Lepple <clepple op gmail.com>:

> It looks like the code path (if ETIME is not defined) is to fall  
> through to a USB reset if -EPIPE happens, and usb_clear_halt() does  
> not succeed.
>
> Is this intentional, or should the #endif be after the block which  
> calls usb_reset()?

It is intentional. The call to usb_clear_halt() usually does the job,  
but on some older FreeBSD versions this function is not implemented.  
In that case, calling usb_reset() might be helpful before reconnecting.

> (I understand that after a usb_reset(), the code needs to fall  
> through to the usb->close() section since the device handle is no  
> longer valid.)

Yes. Whether or not a call to usb_close() is needed might be platform  
dependent though (I'm not completely sure about that).

> I guess it's a personal preference of mine, but I think that any  
> code that relies on falling off the end of a switch case (instead of  
> ending with 'break') should have a brief comment to that effect.

I will need to make a couple of updates to the comments anyway. I'll  
take this into account.

Best regards, Arjen
-- 
Please keep list traffic on the list




More information about the Nut-upsdev mailing list