Hi!
> >>>  +static void sighandler(int sig)
> >>>  +{
> >>>  +        if (sig == SIGSEGV)
> >>>  +                tst_exit();
> >>>  +        else
> >>>  +                tst_resm(TFAIL, "sighandler received invalid 
> >>> signal:%d", sig);
> >>>  +}
> >I'm little worried about the tst_xxx interface used in signal handlers
> >as it is not signal-async-safe and may fail (in strange circumstances).
> >
> >But this is in child process, right? So you could call _exit() and check
> >the return value in parent.
> >
> >Also the return value from tst_resm() would end up as return value from
> >child and wouldn't propagate to parent if I'm not mistaken.
> >
> 
> Would something like:
> 
> static void sighandler(int sig)
> {
>   exit((sig == SIGSEGV) ? 0 : sig);
> }
> 
> be acceptable?

Yes, just use _exit() instead of exit() to be extra safe.

-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to