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

abel deuring adeuring at gmx.net
Sun Feb 3 13:49:12 GMT 2002


Major A 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/...
> > #...
> 
> The problem with this is that it is very platform-specific, and, even
> worse, dependent on whether you use devfs or not (in devfs, in the
> long run, major/minor numbers will be assigned dynamically).

You're right, dynamic major/minor numbers will make things a bit messy
;) But it should not be too difficult to detect, if devfs is being used.
In this case, one could use readlink(2) to resolve any symlinks; if we
end at a devfs node, it should be sufficient to check, if the file name
starts with "/devfs/scsi" or "/devfs/usb", instead of checking the
major/minor numbers.

Abel



More information about the sane-devel mailing list