Re: Why we disable the USB link on platforms other than Linux?



On Fri, 2005-06-24 at 09:17, Calvin Liu wrote:
> Hi, there,
> 
> Here is a piece of code from gpilotd/gpilotd.c. If I'm correct, in line
> 971, g_assert_not_reached() will terminal the process on any platforms
> other than Linux.
> Why we have to do it?

It is a sanity check.
As the name implies, it should never be reached because the
USB_VISOR option only makes sense on linux.

Matt

> 
>         } if (dev->type == PILOT_DEVICE_USB_VISOR) {
> #ifdef WITH_USB_VISOR
> #ifdef linux
>                 /* We want to watch the /proc/bus/usb/devices file once
>                  * per context, and then check all devices each time it
> is
>                  * woken up. */
>                 if (visor_timeout_id == -1) {
>                         visor_timeout_id = g_timeout_add (2000,
> visor_devices_timeout, context);
>                 }
> #else /* linux*/
> 971:                g_assert_not_reached ();
> #endif /* linux */
> #endif /* WITH_USB_VISOR */

Matt Davey		If I've told you n times, I've told you n+1 times....
mcdavey mrao cam ac uk 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]