ksh/ksh93-signals.dif

68 lines
1.8 KiB
Plaintext

--- src/cmd/ksh93/sh/jobs.c
+++ src/cmd/ksh93/sh/jobs.c 2007-12-21 12:17:10.000000000 +0000
@@ -253,7 +253,7 @@ int job_reap(register int sig)
flags |= WNOHANG;
}
pid = waitpid((pid_t)-1,&wstat,flags);
-
+#ifdef WCONTINUED
/*
* some systems (linux 2.6) may return EINVAL
* when there are no continued children
@@ -261,6 +261,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 12:28:04.000000000 +0000
@@ -2773,6 +2773,7 @@ static pid_t sh_ntfork(const Shnode_t *t
{
signal(SIGTTIN,SIG_DFL);
signal(SIGTTOU,SIG_DFL);
+ signal(SIGTSTP,SIG_DFL);
}
#endif /* SIGTSTP */
#ifdef JOBS
@@ -2810,6 +2811,9 @@ static pid_t sh_ntfork(const Shnode_t *t
{
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)
@@ -2894,6 +2898,7 @@ static pid_t sh_ntfork(const Shnode_t *t
{
signal(SIGTTIN,SIG_DFL);
signal(SIGTTOU,SIG_DFL);
+ signal(SIGTSTP,SIG_DFL);
jobwasset++;
}
#endif /* SIGTSTP */
@@ -2932,6 +2957,9 @@ static pid_t sh_ntfork(const Shnode_t *t
{
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)
--- src/cmd/ksh93/data/signals.c
+++ src/cmd/ksh93/data/signals.c 2007-12-21 12:22:32.000000000 +0000
@@ -20,6 +20,7 @@
#include <ast.h>
#include "shtable.h"
#include "fault.h"
+#include "jobs.h"
#if defined(SIGCLD) && !defined(SIGCHLD)
# define SIGCHLD SIGCLD