[sane-devel] All sane frontends segfault with my HP 5200C

Henning Meier-Geinitz henning at meier-geinitz.de
Sun Feb 3 12:07:16 GMT 2002


Hi,

On Sun, Feb 03, 2002 at 12:10:10PM +0100, Oliver Rauch wrote:
> I think we could and should create a function
> sanei_identify_device(char *device_file)
> 
> that has some
> #IFDEF _LINUX_
> test for major/minor number for SCSI/USB/PARALLEL/...
> #...

That's a good idea. I propose a little change:

Add something like sanei_scsi_is_scsi, sanei_scsi_is_usb etc to the
respective sanei files so we don't have to link every backend to yet
another file. So the sanei_usb_open etc. functions would test on their
own.

Maybe something like

SANE_Status
sanei_scsi_is_scsi (SANE_String_Const device_file) /* or (int fd) */
{
#if USE == LINUX_INTERFACE /* is this enough or must we check for __linux__ */
  /* get major and minor number */
  if (major_minor_is_in_range)
    return SANE_STATUS_GOOD;
  else
    return SANE_STATUS_INVAL;
#else
  return SANE_STATUS_UNSUPPORTED;
#endif
}

How can I get the major/minor number of a device file?

Bye,
  Henning



More information about the sane-devel mailing list