SHA256
1
0
forked from pool/tcsh
tcsh/tcsh-6.15.00-history.dif

127 lines
3.1 KiB
Plaintext

--- 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--;
}
}