[sane-devel] Re: Debian SANE HP bug report

Peter Kirchgessner peter@kirchgessner.net
Tue, 06 Aug 2002 21:42:06 +0200


I added a similar handling to the hp-backend in CVS. Now these 
USB-devices should work correctly even if option connect-device is not 


Henning Meier-Geinitz wrote:

> Hi,
> On Tue, Jul 30, 2002 at 07:59:05PM +0200, Peter Kirchgessner wrote:
>>The problem is that the USB-device is tried to be opened as a 
>>SCSI-device. And then I assume it segfaults somewhere below 
>>sanei_scsi_open(). Because of the missing option connect-device.
>>Do you have an idea how to check if a device name is a SCSI-device or 
>>not ? And this should work not only for Linux.
> I don't think there is a generic solution. The Linux test is
> implemented in 1.0.8, other platforms should be possible but nobody provided
> patches until now.
>>I could just add a check to see if the device name contains something
>>like usb and then assume that it is not a SCSI device. 
> Have a look at tools/sane-find-scanner.c. I'm using this kind of
> heuristics to make sure it's not a USB scanner:
>   if (strstr (file_name, "usb")
>         || strstr (file_name, "uscanner") || strstr (file_name, "ugen"))
> 	    {
> 	      /* looks like a USB file */
> 	    }
> However, nobody stops the user from naming his USB scanner /dev/uscn0
> or anything else. And the test is the other way round, it can't test
> for SCSI.
> Bye,
>   Henning
> _______________________________________________
> Sane-devel mailing list
> Sane-devel@www.mostang.com
> http://www.mostang.com/mailman/listinfo/sane-devel

Peter Kirchgessner