Hi,

I'm looking at readline's signal handling code, and I noticed that 
in the current master, the _rl_interrupt_immediately variable is
never set anymore.

I see that _rl_interrupt_immediately used to be set around
rl_attempted_completion_function in complete.c in older releases,
but that signal handling was replaced with the safer
RL_SIG_RECEIVED check in the mainline code.

Is there a reason the _rl_interrupt_immediately variable still
exists, then?  Could rl_signal_handler be simplified, like:

 static RETSIGTYPE
 rl_signal_handler (int sig)
 {
-  if (_rl_interrupt_immediately)
-    {
-      _rl_interrupt_immediately = 0;
-      _rl_handle_signal (sig);
-    }
-  else
-    _rl_caught_signal = sig;
+  _rl_caught_signal = sig;

   SIGHANDLER_RETURN;
 }

?

I was looking at signal handling on Windows, for gdb, assessing its
correctness (given Windows runs signals on a separate thread).  Not
having the _rl_interrupt_immediately==true path simplifies things.

Thanks,
Pedro Alves

_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to