[sane-devel] Using sanei_access: recommended or not?

Henning Meier-Geinitz henning at meier-geinitz.de
Thu Jan 26 17:46:00 UTC 2006


On 2006-01-23 22:29, Lauri Pirttiaho wrote:
> While writing the backend, I noticed so far only plustek
> backend seems to employ sanei_access for locking the
> device. Since in multi user systems it is possible
> that accidentally someone else might try to access a
> scanner in use, I think using the locking mechanism
> provided by sanei_access would make sense.

I think using sanei_access makes sense if your backend doesn't keep
the scanner open between calling sane_open and sane_close. At least
with SCSI and USB scanners, the scanner can't be opened twice at the
same time when the backend works as above. However, if your backend
opens the scanner device (or calls sanei_usb_open) in sane_open and
closes the scanner again and keeps it closed until e.g. sane_start is
called, using sanei_access can be useful.


More information about the sane-devel mailing list