[sane-devel] Has anyone managed to get Snapscan backend working with FreeBSD 8.0 (which uses libusb)?
Oliver Schwartz
Oliver.Schwartz at gmx.de
Thu Jan 28 11:51:35 UTC 2010
Hi all,
On 26.01.2010, at 15:46, m. allan noah wrote:
> Seems like an individual backend should not need to parse the device
> string. Isn't there some other way to come up with a unique semaphore,
> like process id?
the process id could be used, but it may fail theoretically. One
example is a frontend that uses two (snapscan-)scanners at the same
time (not that I think anybody actually does that).
The clean solution is a semaphore per device. In the days before
libusb the backend used ftok(). The current code was written by
Julien, as far as I know, because the ftok() call failed miserably and
the unique id was always 0.
So I guess I'll stay with the device string, but maybe use some sort
of crc instead of parsing it. Other ideas are, of course, welcome.
Kind regards,
Oliver
More information about the sane-devel
mailing list