[sane-devel] signal handling by libsane and backends

Wittawat Yamwong wy-sane-devel at arcor.de
Thu Sep 14 11:30:55 UTC 2006


Hi,

On Thursday 14 September 2006 09:09, Gerhard Jaeger wrote:
> On Tuesday 12 September 2006 04:02, Ryan Reading wrote:
> > The sane library and/or its backends don't seem to "clean up" after
> > themselves by restoring signal handlers and/or signal masks.
> > [...] 
>
> And yes, I think you are right. Grep for sigaction or signal function calls
> within the backend directory and you'll see, that no backend saves the
> old sigmasks or handlers for restoring.

I think, it is OK if the backend modifies sigmasks and/or installs signal 
handlers in the _child_ process but doesn't restore them. On the other hand, 
as Ryan mentioned, it will probably cause problems if you do it in the parent 
process and do not take special care of old sigmasks and signal handlers.

> Even sanei_thread does not restore the tweaked masks/handlers.
> Workaround could be to get the settings before calling any sane function
> and to do the restore stuff on your own.

This should be documented somewhere, maybe in PROBLEMS?

Regards
-- 
Wittawat Yamwong
Hannover, Germany



More information about the sane-devel mailing list