On Wed, Jul 17, 2002 at 06:09:23PM -0400, Glenn Maynard wrote:
> "repeat 0s foo" often requires multiple ^Cs to stop. It seems that
> the CmdExec within SleepJob is being run by the scheduler first, not
> doing anything with the SIGINT (since it's not interactive), and then
> clearing it in exec_parsed_command. Then the main CmdExec runs, but
> the SIGINT is already gone. Maybe ResetCount should only be done in
> exec_parsed_command in the interactive shell? I'm not sure.
I think you are right. Here is another patch.
--
Alexander.
Index: CmdExec.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/CmdExec.cc,v
retrieving revision 1.93
diff -u -p -r1.93 CmdExec.cc
--- CmdExec.cc 2002/07/17 15:04:39 1.93
+++ CmdExec.cc 2002/07/18 06:57:52
@@ -178,9 +178,12 @@ void CmdExec::exec_parsed_command()
prev_exit_code=exit_code;
exit_code=1;
- SignalHook::ResetCount(SIGINT);
- SignalHook::ResetCount(SIGHUP);
- SignalHook::ResetCount(SIGTSTP);
+ if(interactive)
+ {
+ SignalHook::ResetCount(SIGINT);
+ SignalHook::ResetCount(SIGHUP);
+ SignalHook::ResetCount(SIGTSTP);
+ }
bool did_default=false;