[sane-devel] Closing file descriptors opened in sane_get_devices (was Re: [epson2] leaking file descriptors)

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Sun Sep 1 23:51:09 UTC 2013


Alessandro Zummo writes:

> On Thu, 29 Aug 2013 16:53:56 +0900
> Olaf Meeuwissen <olaf.meeuwissen at avasys.jp> wrote:
>
>> In my particular scenario not closing the file descriptor would prevent
>> an alternative backend from recognizing the device as supported if its
>> sane_get_devices() is run after the epson2 one.  If their respective
>> sane_get_devices() are called the other way around, both backends might
>> be able to recognize the device as supported (if the alternative backend
>> closes all its file descriptors).
>> 
>> So my question really boils down to whether backends must/should close
>> any file descriptors opened as a result of calling sane_get_devices().
>
>  As far as I can see, epson2 closes the device during attach, so it should
>  be available to other backends.

Indeed, it does.  I wrote my mail before checking (my bad) but the issue
may be lurking in other backends as well.
-- 
Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom
                 http://www.fsf.org/jf?referrer=1962



More information about the sane-devel mailing list