Re: shelving misc patches
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;
Re: shelving misc patches
On Thu, Jul 18, 2002 at 11:01:33AM +0400, Alexander V. Lukyanov wrote: I think you are right. Here is another patch. This fixes the repeat 0 foo problem, but repeat 0 !echo hi still has problems. I'm not sure why. I'll try to track it down. (I'm not sure where the signal's going.) -- Glenn Maynard
Re: shelving misc patches
On Thu, Jul 18, 2002 at 04:18:06AM -0400, Glenn Maynard wrote: On Thu, Jul 18, 2002 at 11:01:33AM +0400, Alexander V. Lukyanov wrote: I think you are right. Here is another patch. This fixes the repeat 0 foo problem, but repeat 0 !echo hi still has problems. I'm not sure why. I'll try to track it down. (I'm not sure where the signal's going.) I don't have such a problem here on solaris. -- Alexander.
Re: shelving misc patches
On Sat, Jul 13, 2002 at 12:00:09AM -0400, Glenn Maynard wrote: You left out the rest of the stuff in that file, too ... What did I forget? The repeat problem isn't completely contrived, by the way; it also happens when any filters are used (ie. repeat 0s zcat file). There is a way to solve it. Check exit status and increase SIGINT count if the subprocess died by signal. I don't particularly like it, but it should work. Attached: FAQ: add an entry for ^Z in Cygwin. Applied. -- Alexander.
Re: shelving misc patches
On Wed, Jul 10, 2002 at 10:07:58PM -0400, Glenn Maynard wrote: Try: repeat 0s !echo hi A ^C gets eaten by the child job; you have to mash ^C to stop it. I'm not sure there's a clean way to fix this. (Repeat shouldn't stop if its command exits with an error; perhaps it should exit if the command exits because of an interrupt?) Try this patch. -- Alexander. Index: ProcWait.cc === RCS file: /home/lav/cvsroot/lftp/src/ProcWait.cc,v retrieving revision 1.14 diff -u -p -u -r1.14 ProcWait.cc --- ProcWait.cc 2002/03/18 16:29:28 1.14 +++ ProcWait.cc 2002/07/17 07:58:34 -83,6 +83,8 bool ProcWait::handle_info(int info) } else { + if(WIFSIGNALED(info) WTERMSIG(info)==SIGINT) +SignalHook::IncreaseCount(SIGINT); status=TERMINATED; term_info=info; return true;
Re: shelving misc patches
On Wed, Jul 17, 2002 at 07:09:41PM +0400, Alexander V. Lukyanov wrote: Try: repeat 0s !echo hi A ^C gets eaten by the child job; you have to mash ^C to stop it. I'm not sure there's a clean way to fix this. (Repeat shouldn't stop if its command exits with an error; perhaps it should exit if the command exits because of an interrupt?) Try this patch. Hmm. This helps, but there seems to be something else going on, too. 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. repeat 0s !echo hello does the same thing, but tends to require me to hold down ^C to stop it (for the above, ^C fails about 50% of the time; here it fails about 95% of the time.) I don't know if this is the same problem. -- Glenn Maynard
Re: shelving misc patches
On Wed, Jul 10, 2002 at 10:07:58PM -0400, Glenn Maynard wrote: On Wed, Jul 10, 2002 at 03:15:02PM +0400, Alexander V. Lukyanov wrote: I have committed it to cvs, without commented out test code. Normally I'd bash on this a bit more before sending it in, but since the stuff in CVS right now is pretty buggy, I'll send this now. Patches applied. I left out debug resource for now, maybe will add it later, along with other debug settings. -- Alexander. | http://www.yars.free.net/~lav/
Re: shelving misc patches
On Fri, Jul 12, 2002 at 02:10:43PM +0400, Alexander V. Lukyanov wrote: Patches applied. I left out debug resource for now, maybe will add it later, along with other debug settings. You left out the rest of the stuff in that file, too ... The repeat problem isn't completely contrived, by the way; it also happens when any filters are used (ie. repeat 0s zcat file). Attached: FAQ: add an entry for ^Z in Cygwin. -- Glenn Maynard Index: FAQ === RCS file: /home/lav/cvsroot/lftp/FAQ,v retrieving revision 1.7 diff -u -r1.7 FAQ --- FAQ 2002/06/02 10:21:44 1.7 +++ FAQ 2002/07/13 03:57:44 -31,3 +31,7 Q: Why doesn't mirror download files starting with a dot? I can see the files using `ls -a'. A: Try `set ftp:list-options -a'. + +Q: ^Z doesn't work in Cygwin. +A: Use SET CYGWIN=TTY. This must be done before starting a shell, if any. +
Re: shelving misc patches
On Tue, Jul 09, 2002 at 06:00:42PM -0400, Glenn Maynard wrote: On Tue, Jul 09, 2002 at 01:58:53PM +0400, Alexander V. Lukyanov wrote: OutputJob. It's useful, fixes the cls bug, and makes buffered outputting trivial from any job, but it's still a bit overcomplicated and I havn't had the interest in it recently to nail down the rest of the bugs. (You don't seem particularly interested in it, either.) I'm going to apply this. Thanks! for_each is finally eliminated. As I said, there're some bugs and leaks I havn't nailed down. If you're interested in this code, I'll work on solidifying this. I have committed it to cvs, without commented out test code. Some things were broken by this patch. I'll look at that again. I'm not too concerned about it, it'd just be nice to get rid of acconfig.h eventually. Ok, it is good thing to do. I've noticed that it is acually partially applied. Could you check what is not applied and still needed? By the way, small .cvsignore patch attached, to ignore some of the newer autoconf/automake junk. Thanks. There area bunch of files in the m4/ directory that some autoconf script is adding automatically: ? m4/codeset.m4 ? m4/gettext.m4 ? m4/glibc21.m4 ? m4/iconv.m4 ? m4/isc-posix.m4 ? m4/lcmessage.m4 ? m4/lib-ld.m4 ? m4/lib-link.m4 ? m4/lib-prefix.m4 ? m4/progtest.m4 automake (GNU automake) 1.6.1 autoconf (GNU Autoconf) 2.53 I don't know why it's doing that, or if you want to import those. (It's strange--those are supposed to be imported when creating configure, not copied into the tree.) It is gettextize who adds the files. -- Alexander. | http://www.yars.free.net/~lav/