[sane-devel] Re: Sane backend sm3600 do not working

Henning Meier-Geinitz henning@meier-geinitz.de
Thu, 26 May 2005 11:33:33 +0200


Hi Marian,

Is there any reason not to apply the patch posted by Julien (attached
below)? Otherwise I'd commit it to CVS.

Bye,
  Henning

On Sat, Apr 30, 2005 at 02:16:04PM +0200, Julien BLACHE wrote:
> Marian Eichholz <marian.eichholz@freenet-ag.de> wrote:
> 
> >> "SANE_DEBUG_SM3600=255 scanimage -L"
> >> ---cut here---
> >> [sanei_debug] Setting debug level of sm3600 to 255.
> >> [sm3600] SM3600 init
> >> [sm3600] SM3600 version: 1000005
> >
> > Thats pretty much sparse. Is usbdevfs in place?
> 
> There's a bug in sane_init(), a misuse of usb_find_busses(). Patch
> attached.
> 
> >From the libusb documentation:
> ---
> usb_find_busses will find all of the busses on the system. Returns the
> number of changes since previous call to this function (total of new
> busses and busses removed).
> ---
> 
> JB.
> 
> -- 
> Julien BLACHE                                   <http://www.jblache.org> 
> <jb@jblache.org>                                  GPG KeyID 0xF5D65169
> 

Content-Description: sane_init libusb patch
> Index: backend/sm3600.c
> ===================================================================
> RCS file: /cvsroot/sane/sane-backends/backend/sm3600.c,v
> retrieving revision 1.12
> diff -u -r1.12 sm3600.c
> --- backend/sm3600.c	15 Apr 2004 19:56:53 -0000	1.12
> +++ backend/sm3600.c	30 Apr 2005 12:13:02 -0000
> @@ -374,11 +374,12 @@
>    pdevFirst=NULL;
>  
>    usb_init();
> -  rc=usb_find_busses();
> -  if (rc)
> -    return SANE_STATUS_GOOD;
> +  usb_find_busses();
> +  if (!usb_busses)
> +    return SANE_STATUS_IO_ERROR;
> +
>    usb_find_devices();
> -  if (!usb_busses) return SANE_STATUS_IO_ERROR;
> +
>    iBus=0;
>    DBG(DEBUG_INFO,"starting bus scan\n");
>    for (pbus = usb_busses; pbus; pbus = pbus->next)