From f719ff039932171777328710ffbd682d3112886834f57b96e62c6564f4802b73 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 12 Oct 2007 22:12:53 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/tcsh?expand=0&rev=8 --- tcsh-6.15.00-history.dif | 126 +++++++++++++++++++++++++++++++++++++++ tcsh-6.15.00.dif | 3 +- tcsh.changes | 7 +++ tcsh.spec | 12 ++-- 4 files changed, 143 insertions(+), 5 deletions(-) create mode 100644 tcsh-6.15.00-history.dif diff --git a/tcsh-6.15.00-history.dif b/tcsh-6.15.00-history.dif new file mode 100644 index 0000000..f5c5880 --- /dev/null +++ b/tcsh-6.15.00-history.dif @@ -0,0 +1,126 @@ +--- sh.c ++++ sh.c 2007-10-12 00:00:00.000000000 +0200 +@@ -1770,7 +1770,7 @@ static Char *jobargv[2] = {STRjobs, 0} + * and finally go through the normal error mechanism, which + * gets a chance to make the shell go away. + */ +-int just_signaled; /* bugfix by Michael Bloom (mg@ttidca.TTI.COM) */ ++int just_signaled = 0; /* bugfix by Michael Bloom (mg@ttidca.TTI.COM) */ + + void + pintr(void) +--- sh.h ++++ sh.h 2007-10-12 00:00:00.000000000 +0200 +@@ -548,6 +548,7 @@ EXTERN int neednote IZERO; /* Need to + EXTERN int noexec IZERO; /* Don't execute, just syntax check */ + EXTERN int pjobs IZERO; /* want to print jobs if interrupted */ + EXTERN int setintr IZERO; /* Set interrupts on/off -> Wait intr... */ ++EXTERN int handle_intr IZERO;/* Set interrupts on/off -> Wait intr... */ + EXTERN int havhash IZERO; /* path hashing is available */ + EXTERN int editing IZERO; /* doing filename expansion and line editing */ + EXTERN int noediting IZERO; /* initial $term defaulted to noedit */ +--- sh.hist.c ++++ sh.hist.c 2007-10-12 00:00:00.000000000 +0200 +@@ -425,9 +425,9 @@ rechist(Char *fname, int ref) + if (shist->vec[1] && eq(shist->vec[1], STRmerge)) + loadhist(fname, 1); + fp = xcreat(short2str(fname), 0600); ++ cleanup_until(fname); + if (fp == -1) { + didfds = oldidfds; +- cleanup_until(fname); + return; + } + ftmp = SHOUT; +@@ -437,7 +437,6 @@ rechist(Char *fname, int ref) + xclose(fp); + SHOUT = ftmp; + didfds = oldidfds; +- cleanup_until(fname); + } + + +--- sh.print.c ++++ sh.print.c 2007-10-12 00:00:00.000000000 +0200 +@@ -234,7 +234,8 @@ flush(void) + if (interrupted) { + interrupted = 0; + linp = linbuf; /* avoid recursion as stderror calls flush */ +- stderror(ERR_SILENT); ++ if (handle_intr == 0) ++ stderror(ERR_SILENT); + } + interrupted = 1; + if (haderr) +@@ -256,6 +257,8 @@ flush(void) + #ifdef EIO + /* We lost our tty */ + case EIO: ++ if (handle_intr) ++ break; + #endif + #ifdef ENXIO + /* +@@ -263,12 +266,16 @@ flush(void) + * we lose our tty. + */ + case ENXIO: ++ if (handle_intr) ++ break; + #endif + /* + * IRIX 6.4 bogocity? + */ + #ifdef ENOTTY + case ENOTTY: ++ if (handle_intr) ++ break; + #endif + #ifdef EBADF + case EBADF: +@@ -284,6 +291,8 @@ flush(void) + */ + #ifdef EDQUOT + case EDQUOT: ++ if (handle_intr) ++ break; + #endif + /* Nothing to do, but die */ + xexit(1); +--- tc.sig.c ++++ tc.sig.c 2007-10-12 00:00:00.000000000 +0200 +@@ -60,25 +60,34 @@ int alrmcatch_disabled; /* = 0; */ + int phup_disabled; /* = 0; */ + int pchild_disabled; /* = 0; */ + int pintr_disabled; /* = 0; */ ++int handle_intr = 0; + + void + handle_pending_signals(void) + { + if (!phup_disabled && phup_pending) { + phup_pending = 0; ++ handle_intr++; + phup(); ++ handle_intr--; + } + if (!pintr_disabled && pintr_pending) { + pintr_pending = 0; ++ handle_intr++; + pintr(); ++ handle_intr--; + } + if (!pchild_disabled && pchild_pending) { + pchild_pending = 0; ++ handle_intr++; + pchild(); ++ handle_intr--; + } + if (!alrmcatch_disabled && alrmcatch_pending) { + alrmcatch_pending = 0; ++ handle_intr++; + alrmcatch(); ++ handle_intr--; + } + } + diff --git a/tcsh-6.15.00.dif b/tcsh-6.15.00.dif index afd5511..4b80f7a 100644 --- a/tcsh-6.15.00.dif +++ b/tcsh-6.15.00.dif @@ -1,11 +1,12 @@ --- .pkgextract +++ .pkgextract 2006-04-25 14:58:31.000000000 +0200 -@@ -0,0 +1,5 @@ +@@ -0,0 +1,6 @@ +patch -p0 -s --suffix=.spell < ../tcsh-6.15.00-spelling.dif +patch -p0 -s --suffix=.utf8 < ../tcsh-6.15.00-utf8.dif +patch -p0 -s --suffix=.pipe < ../tcsh-6.15.00-pipe.dif +patch -p0 -s --suffix=.longjmp < ../tcsh-6.15.00-longjmp.dif +patch -p0 -s --suffix=.normcmd < ../tcsh-6.15.00-norm-cmd.dif ++patch -p0 -s --suffix=.history < ../tcsh-6.15.00-history.dif --- Makefile.in +++ Makefile.in 2006-04-25 14:58:31.000000000 +0200 @@ -510,12 +510,12 @@ vgrind: diff --git a/tcsh.changes b/tcsh.changes index 47796d6..d890fba 100644 --- a/tcsh.changes +++ b/tcsh.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Oct 12 18:18:11 CEST 2007 - werner@suse.de + +- Fix save history bug: do not jump out from handler for pending + signals like for SIGHUP, just run the handler up to its end and + ignore any error happen to be interrupted (bug #331627) + ------------------------------------------------------------------- Tue Aug 28 12:16:59 CEST 2007 - werner@suse.de diff --git a/tcsh.spec b/tcsh.spec index cca2562..7b37b46 100644 --- a/tcsh.spec +++ b/tcsh.spec @@ -12,13 +12,13 @@ Name: tcsh BuildRequires: ncurses-devel -URL: http://www.tcsh.org/ +Url: http://www.tcsh.org/ License: BSD 3-Clause Group: System/Shells Requires: gawk textutils -Autoreqprov: on +AutoReqProv: on Version: 6.15.00 -Release: 15 +Release: 22 Summary: The C SHell Source: ftp.astron.com:/pub/tcsh/tcsh-6.15.00.tar.bz2 Source1: nls-iconv @@ -30,6 +30,7 @@ Patch2: tcsh-6.15.00-utf8.dif Patch3: tcsh-6.15.00-pipe.dif Patch4: tcsh-6.15.00-longjmp.dif Patch5: tcsh-6.15.00-norm-cmd.dif +Patch6: tcsh-6.15.00-history.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -133,8 +134,11 @@ Authors: %doc %{_mandir}/man1/csh.1.gz %doc %{_mandir}/man1/tcsh.1.gz %{_datadir}/locale/*/LC_MESSAGES/tcsh - %changelog +* Fri Oct 12 2007 - werner@suse.de +- Fix save history bug: do not jump out from handler for pending + signals like for SIGHUP, just run the handler up to its end and + ignore any error happen to be interrupted (bug #331627) * Tue Aug 28 2007 - werner@suse.de - Correct boolean expression for normalize-command (bug #304903) * Mon Jul 23 2007 - werner@suse.de