fix SIGTTOU handling, spawned processes, spec file, remove redundant
builtins
This commit is contained in:
parent
14575a1334
commit
8a6e4f28df
18
ksh-20070328-builtins.patch
Normal file
18
ksh-20070328-builtins.patch
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
--- ksh-20070328/src/cmd/ksh93/data/builtins.c.builtoff 2007-05-22 13:14:33.000000000 +0200
|
||||||
|
+++ ksh-20070328/src/cmd/ksh93/data/builtins.c 2007-05-22 13:14:51.000000000 +0200
|
||||||
|
@@ -128,6 +128,7 @@
|
||||||
|
#ifdef SHOPT_CMDLIB_HDR
|
||||||
|
#include SHOPT_CMDLIB_HDR
|
||||||
|
#else
|
||||||
|
+#if 0
|
||||||
|
CMDLIST(basename)
|
||||||
|
CMDLIST(chmod)
|
||||||
|
CMDLIST(dirname)
|
||||||
|
@@ -141,6 +142,7 @@
|
||||||
|
CMDLIST(wc)
|
||||||
|
CMDLIST(sync)
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
"", 0, 0
|
||||||
|
};
|
||||||
|
|
33
ksh-20070328-exit19.patch
Normal file
33
ksh-20070328-exit19.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
--- ksh-20070328/src/cmd/ksh93/sh/jobs.c.exit19 2007-05-22 11:51:10.000000000 +0200
|
||||||
|
+++ ksh-20070328/src/cmd/ksh93/sh/jobs.c 2007-05-22 11:55:55.000000000 +0200
|
||||||
|
@@ -307,7 +307,8 @@
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pw->p_flag |= (P_DONE|P_NOTIFY);
|
||||||
|
- if(WEXITSTATUS(wstat) > pw->p_exit)
|
||||||
|
+ pw->p_exit = pw->p_exitmin;
|
||||||
|
+ if(WEXITSTATUS(wstat) > pw->p_exitmin)
|
||||||
|
pw->p_exit = WEXITSTATUS(wstat);
|
||||||
|
}
|
||||||
|
if(pw->p_pgrp==0)
|
||||||
|
@@ -1068,8 +1069,8 @@
|
||||||
|
pw->p_env = sh.curenv;
|
||||||
|
pw->p_pid = pid;
|
||||||
|
pw->p_flag = P_EXITSAVE;
|
||||||
|
- pw->p_exit = sh.xargexit;
|
||||||
|
- sh.xargexit = 0;
|
||||||
|
+ pw->p_exitmin = sh.xargexit;
|
||||||
|
+ pw->p_exit = 0;
|
||||||
|
if(sh_isstate(SH_MONITOR))
|
||||||
|
{
|
||||||
|
if(killpg(job.curpgid,0)<0 && errno==ESRCH)
|
||||||
|
--- ksh-20070328/src/cmd/ksh93/include/jobs.h.exit19 2007-05-22 11:51:29.000000000 +0200
|
||||||
|
+++ ksh-20070328/src/cmd/ksh93/include/jobs.h 2007-05-22 11:52:14.000000000 +0200
|
||||||
|
@@ -64,6 +64,7 @@
|
||||||
|
pid_t p_fgrp; /* process group when stopped */
|
||||||
|
short p_job; /* job number of process */
|
||||||
|
unsigned short p_exit; /* exit value or signal number */
|
||||||
|
+ unsigned short p_exitmin; /* minimum exit value for xargs */
|
||||||
|
unsigned char p_flag; /* flags - see below */
|
||||||
|
int p_env; /* subshell environment number */
|
||||||
|
#ifdef JOBS
|
19
ksh-20070328-ttou.patch
Normal file
19
ksh-20070328-ttou.patch
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
--- ksh-20070328/src/cmd/ksh93/sh/jobs.c.ttou 2007-05-22 12:47:38.000000000 +0200
|
||||||
|
+++ ksh-20070328/src/cmd/ksh93/sh/jobs.c 2007-05-22 12:50:24.000000000 +0200
|
||||||
|
@@ -609,9 +609,16 @@
|
||||||
|
{
|
||||||
|
/* save the terminal state for current job */
|
||||||
|
#ifdef SIGTSTP
|
||||||
|
+ Sig_handler_t saved_handler;
|
||||||
|
+
|
||||||
|
+ saved_handler = signal(SIGTTOU, SIG_IGN);
|
||||||
|
job_fgrp(pw,tcgetpgrp(job.fd));
|
||||||
|
if(tcsetpgrp(job.fd,sh.pid) !=0)
|
||||||
|
+ {
|
||||||
|
+ signal(SIGTTOU, saved_handler);
|
||||||
|
return;
|
||||||
|
+ }
|
||||||
|
+ signal(SIGTTOU, saved_handler);
|
||||||
|
#endif /* SIGTSTP */
|
||||||
|
/* force the following tty_get() to do a tcgetattr() */
|
||||||
|
tty_set(-1, 0, NIL(struct termios*));
|
22
ksh.spec
22
ksh.spec
@ -8,7 +8,7 @@ URL: http://www.kornshell.com/
|
|||||||
Group: Applications/Shells
|
Group: Applications/Shells
|
||||||
License: Common Public License Version 1.0
|
License: Common Public License Version 1.0
|
||||||
Version: 20070328
|
Version: 20070328
|
||||||
Release: 1
|
Release: 2%{?dist}
|
||||||
#Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.linux.i386.tgz
|
#Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.linux.i386.tgz
|
||||||
Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz
|
Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz
|
||||||
Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz
|
Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz
|
||||||
@ -18,6 +18,9 @@ Patch1: ksh-20070328-uname.patch
|
|||||||
Patch2: ksh-20070328-useex.patch
|
Patch2: ksh-20070328-useex.patch
|
||||||
Patch3: ksh-20070328-loginsh.patch
|
Patch3: ksh-20070328-loginsh.patch
|
||||||
Patch4: ksh-20070328-leak.patch
|
Patch4: ksh-20070328-leak.patch
|
||||||
|
Patch5: ksh-20070328-exit19.patch
|
||||||
|
Patch6: ksh-20070328-builtins.patch
|
||||||
|
Patch7: ksh-20070328-ttou.patch
|
||||||
# for debugging only:
|
# for debugging only:
|
||||||
#Patch100: ksh-20060124-iffedebug.patch
|
#Patch100: ksh-20060124-iffedebug.patch
|
||||||
|
|
||||||
@ -26,6 +29,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|||||||
Provides: ksh93
|
Provides: ksh93
|
||||||
Obsoletes: ksh93
|
Obsoletes: ksh93
|
||||||
Conflicts: pdksh
|
Conflicts: pdksh
|
||||||
|
Requires: coreutils, glibc-common, diffutils
|
||||||
Requires(post): grep, coreutils
|
Requires(post): grep, coreutils
|
||||||
Requires(preun): grep, coreutils
|
Requires(preun): grep, coreutils
|
||||||
|
|
||||||
@ -44,14 +48,16 @@ with "sh" (the Bourne Shell).
|
|||||||
%patch2 -p1 -b .use_ex
|
%patch2 -p1 -b .use_ex
|
||||||
%patch3 -p1 -b .loginsh
|
%patch3 -p1 -b .loginsh
|
||||||
%patch4 -p1 -b .leak
|
%patch4 -p1 -b .leak
|
||||||
|
%patch5 -p1 -b .exit19
|
||||||
|
%patch6 -p1 -b .builtins
|
||||||
|
%patch7 -p1 -b .ttou
|
||||||
#patch100 -p1 -b .iffedebug
|
#patch100 -p1 -b .iffedebug
|
||||||
|
|
||||||
%build
|
%build
|
||||||
./bin/package "read" ||:
|
./bin/package "read" ||:
|
||||||
# Use this for debugging:
|
export CCFLAGS="$RPM_OPT_FLAGS"
|
||||||
#export CCFLAGS="-O0 -ggdb"
|
export CC=gcc
|
||||||
#./bin/package DEBUG "make"
|
./bin/package "make"
|
||||||
./bin/package "make" %{?_smp_mflags}
|
|
||||||
cp lib/package/LICENSES/ast LICENSE
|
cp lib/package/LICENSES/ast LICENSE
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -103,6 +109,12 @@ fi
|
|||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue May 22 2007 Tomas Smetana <tsmetana@redhat.com> 20070328-2
|
||||||
|
- fix wrong exit status of spawned process after SIGSTOP
|
||||||
|
- fix building of debuginfo package, add %%{?dist} to release
|
||||||
|
- fix handling of SIGTTOU in non-interactive shell
|
||||||
|
- remove useless builtins
|
||||||
|
|
||||||
* Thu Apr 19 2007 Tomas Smetana <tsmetana@redhat.com> 20070328-1
|
* Thu Apr 19 2007 Tomas Smetana <tsmetana@redhat.com> 20070328-1
|
||||||
- new upstream source
|
- new upstream source
|
||||||
- fix login shell invocation (#182397)
|
- fix login shell invocation (#182397)
|
||||||
|
Loading…
Reference in New Issue
Block a user