[ksh] do not hang after return code 12

Michal Hlavinka mhlavink at fedoraproject.org
Mon Mar 19 11:52:56 UTC 2012


commit c7f72d5f3b7443cf914f93620500ea250b3b72c5
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Mon Mar 19 12:52:50 2012 +0100

    do not hang after return code 12

 .gitignore                  |    2 ++
 ksh-20120214-tildafix.patch |   16 ----------------
 ksh-20120229-rc12hang.patch |   21 +++++++++++++++++++++
 ksh.spec                    |   15 ++++++++++-----
 sources                     |    4 ++--
 5 files changed, 35 insertions(+), 23 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b0af89b..3079db4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,3 +42,5 @@ INIT.2010-07-01.tgz
 /INIT.2012-02-02.tgz
 /ast-ksh.2012-02-14.tgz
 /INIT.2012-02-14.tgz
+/ast-ksh.2012-02-29.tgz
+/INIT.2012-02-29.tgz
diff --git a/ksh-20120229-rc12hang.patch b/ksh-20120229-rc12hang.patch
new file mode 100644
index 0000000..49cef4a
--- /dev/null
+++ b/ksh-20120229-rc12hang.patch
@@ -0,0 +1,21 @@
+diff -up ksh-20120229/src/cmd/ksh93/sh/xec.c.rc12hang ksh-20120229/src/cmd/ksh93/sh/xec.c
+--- ksh-20120229/src/cmd/ksh93/sh/xec.c.rc12hang	2012-03-02 17:37:09.000000000 +0100
++++ ksh-20120229/src/cmd/ksh93/sh/xec.c	2012-03-19 11:29:41.002964239 +0100
+@@ -1623,7 +1623,7 @@ int sh_exec(register const Shnode_t *t,
+ 					else
+ 						job_wait(parent);
+ 					if(shp->topfd > topfd)
+-						sh_iorestore(shp,topfd,sh.exitval);
++						sh_iorestore(shp,topfd,0);
+ 					if(usepipe && tsetio &&  subdup)
+ 						iounpipe(shp);
+ 					if(!sh_isoption(SH_MONITOR))
+@@ -3079,7 +3079,7 @@ pid_t _sh_fork(Shell_t *shp,register pid
+ 			if(!tsetio || !subdup)
+ 			{
+ 				if(shp->topfd > restorefd)
+-					sh_iorestore(shp,restorefd,sh.exitval);
++					sh_iorestore(shp,restorefd,0);
+ 				iounpipe(shp);
+ 			}
+ 		}
diff --git a/ksh.spec b/ksh.spec
index d5209cd..ef1237c 100644
--- a/ksh.spec
+++ b/ksh.spec
@@ -1,11 +1,11 @@
-%global       releasedate 2012-02-14
+%global       releasedate 2012-02-29
 
 Name:         ksh
 Summary:      The Original ATT Korn Shell
 URL:          http://www.kornshell.com/
 Group:        System Environment/Shells
 License:      EPL
-Version:      20120214
+Version:      20120229
 Release:      2%{?dist}
 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
@@ -20,8 +20,7 @@ Patch1:       ksh-20070328-builtins.patch
 #fix regression test suite to be usable during packagebuild - Fedora/RHEL specific
 Patch2:       ksh-20100826-fixregr.patch
 
-# for ksh <= 2012-03-09, fix tilda expansion, rhbz#802565
-Patch3: ksh-20120214-tildafix.patch
+Patch3:       ksh-20120229-rc12hang.patch
 
 BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Conflicts:    pdksh
@@ -43,7 +42,7 @@ with "sh" (the Bourne Shell).
 %setup -q -T -D -a 1
 %patch1 -p1 -b .builtins
 %patch2 -p1 -b .fixregr
-%patch3 -p1 -b .tildafix
+%patch3 -p1 -b .rc12hang
 
 #/dev/fd test does not work because of mock
 sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options
@@ -129,6 +128,12 @@ fi
     rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Mon Mar 19 2012 Michal Hlavinka <mhlavink at redhat.com> - 20120229-2
+- do not hang after return code 12
+
+* Wed Mar 14 2012 Michal Hlavinka <mhlavink at redhat.com> - 20120229-1
+- ksh updated to 2012-02-29
+
 * Tue Mar 13 2012 Michal Hlavinka <mhlavink at redhat.com> - 20120214-2
 - fix tilda expansion in scripts
 
diff --git a/sources b/sources
index 46d2732..c1b610e 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-f1c11472bca832e44b7ad553c9fc3d07  ast-ksh.2012-02-14.tgz
-5375a11e4fb71d766fa693fe3cfda970  INIT.2012-02-14.tgz
+2ed0c6d28ed4b5edaf913b5de3259737  ast-ksh.2012-02-29.tgz
+0ef3c9413b69358503aa3cb297c532c4  INIT.2012-02-29.tgz


More information about the scm-commits mailing list