ksh/ksh93-signals.dif

69 lines
1.9 KiB
Plaintext

--- src/cmd/ksh93/data/signals.c
+++ src/cmd/ksh93/data/signals.c 2008-09-11 15:49:02.645531304 +0000
@@ -18,6 +18,8 @@
* *
***********************************************************************/
#include <ast.h>
+#include <cmd.h>
+#include <jobs.h>
#include "shtable.h"
#include "fault.h"
--- src/cmd/ksh93/sh/jobs.c
+++ src/cmd/ksh93/sh/jobs.c 2008-09-11 17:13:20.896069796 +0200
@@ -260,7 +260,7 @@ int job_reap(register int sig)
}
pid = waitpid((pid_t)-1,&wstat,flags);
sh_offstate(SH_TTYWAIT);
-
+#ifdef WCONTINUED
/*
* some systems (linux 2.6) may return EINVAL
* when there are no continued children
@@ -268,6 +268,7 @@ int job_reap(register int sig)
if (pid<0 && errno==EINVAL && (flags&WCONTINUED))
pid = waitpid((pid_t)-1,&wstat,flags&=~WCONTINUED);
+#endif
sh_sigcheck();
if(sig && pid<0 && errno==EINTR)
continue;
--- src/cmd/ksh93/sh/xec.c
+++ src/cmd/ksh93/sh/xec.c 2007-12-21 13:28:04.000000000 +0100
@@ -2894,6 +2894,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons
{
signal(SIGTTIN,SIG_DFL);
signal(SIGTTOU,SIG_DFL);
+ signal(SIGTSTP,SIG_DFL);
}
#endif /* SIGTSTP */
#ifdef JOBS
@@ -2931,6 +2932,9 @@ static pid_t sh_ntfork(Shell_t *shp,cons
{
signal(SIGTTIN,SIG_IGN);
signal(SIGTTOU,SIG_IGN);
+ if(sh_isstate(SH_INTERACTIVE))
+ signal(SIGTSTP,SIG_IGN);
+ else signal(SIGTSTP,SIG_DFL);
}
#endif /* SIGTSTP */
if(spawnpid>0)
@@ -3011,6 +3015,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons
{
signal(SIGTTIN,SIG_DFL);
signal(SIGTTOU,SIG_DFL);
+ signal(SIGTSTP,SIG_DFL);
jobwasset++;
}
#endif /* SIGTSTP */
@@ -3069,6 +3074,9 @@ static pid_t sh_ntfork(Shell_t *shp,cons
{
signal(SIGTTIN,SIG_IGN);
signal(SIGTTOU,SIG_IGN);
+ if(sh_isstate(SH_INTERACTIVE))
+ signal(SIGTSTP,SIG_IGN);
+ else signal(SIGTSTP,SIG_DFL);
}
#endif /* SIGTSTP */
if(sigwasset)