[sane-devel] Use poll() instead of select() in backends

Nils Philippsen nils at tiptoe.de
Fri Aug 29 10:23:20 UTC 2014

On Fri, 2014-08-29 at 00:19 +0200, Alessandro Zummo wrote:
> On Thu, 28 Aug 2014 17:58:52 +0200
> Nils Philippsen <nils at tiptoe.de> wrote:
> > I think we should at least default to using poll() (so LO and possibly
> > OO don't crash if they use SANE and a networked scanner), but if we
> > don't support platforms that don't have it it's much less clutter to
> > ditch select() and replace it with poll() completely. Otherwise it's
> > something that should maybe be abstracted away in sanei.
> > 
> > What's your opinion?
>  Well, I'd add a check to the select call.

I thought about that, too, but what then? I mean failing if FD > 1024 is
better than crashing the whole program, but I guess it could confuse
people a good deal if they couldn't scan from their networked scanner
only in LO, but not other apps which are a bit more frugal in their
consumption of FDs.

>  But if you have a working patch with poll() I'll gladly check it ;)

I wanted to sound out what would be acceptable -- I for myself would
just drop select() for poll() wholesale to be on the safe side, but as I
said, I'm not sure if we are supporting platforms that don't have

Nils Philippsen / Wilhelmstraße 22 / D-71229 Leonberg 
nils at tiptoe.de / nils at redhat.com
PGP fingerprint:  C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011
Ever noticed that common sense isn't really all that common?

More information about the sane-devel mailing list