reprogramming SIG_INT

Hi,
I've seen at TaskBrowser's code that SIGINT is temporarily reprogrammed while readline is called. http://www.manpagez.com/info/rlman/rlman-6.0/rlman_43.php describes why readline needs this.

The problem is that our code reprograms most signals to ensure that we quit nicely before aborting our programs. But since the TaskBrowser calls ::signal( SIGINT, SIG_DFL ); after executing a command, our handler is disabled.

The solution is to get the old signal handler returned by rl_set_sighandler ...
static SigHandler *rl_set_sighandler (sig, handler, ohandler)

...and reset it instead of default it with SIG_DFL

thanks

reprogramming SIG_INT

On Wed, Apr 29, 2009 at 1:17 PM, <orocos [..] ...> wrote:

> Hi,
> I've seen at TaskBrowser's code that SIGINT is temporarily reprogrammed
> while readline is called.
> http://www.manpagez.com/info/rlman/rlman-6.0/rlman_43.php describes why
> readline needs this.
>
> The problem is that our code reprograms most signals to ensure that we quit
> nicely before aborting our programs. But since the TaskBrowser calls
> ::signal( SIGINT, SIG_DFL ); after executing a command, our handler is
> disabled.
>
> The solution is to get the old signal handler returned by rl_set_sighandler
> ...
> static SigHandler *rl_set_sighandler (sig, handler, ohandler)
>
> ...and reset it instead of default it with SIG_DFL

Thanks for this input. I had been playing in the past to get the
SIGINT/Ctrl-C signal handler working correctly,
but was not very successful. If you could submit a patch (or point to online
code that does the correct thing),
that would be great.

If you'd like to get this fixed by someone else, submit a bug report on
https://www.fmtc.be/bugzilla/orocos

Peter