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

abel deuring a.deuring@satzbau-gmbh.de
Wed, 31 Jul 2002 00:07:49 +0200


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.

Right, it is probably impossible to catch all strange cases, but the way 
how the Linux implementation of sanei_scsi_open_extended tries to check, 
if an SG file is opened, can most likely also be implemented for other 
OS and also not only for SG device files: Simply try an ioctl which is 
specific for the device type, SG_GET_TIMEOUT in the case of the Linux SG 
driver.

Abel