From 1801570423ca7042f74129321346a0d79ae6fd1b Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Oct 04 2011 07:38:07 +0000 Subject: restore tty settings after timed out read (#572291) --- diff --git a/ksh-20110630-tmoutfix.patch b/ksh-20110630-tmoutfix.patch new file mode 100644 index 0000000..b08eb1b --- /dev/null +++ b/ksh-20110630-tmoutfix.patch @@ -0,0 +1,12 @@ +diff -up ksh-20110630/src/cmd/ksh93/bltins/read.c.tmoutfix ksh-20110630/src/cmd/ksh93/bltins/read.c +--- ksh-20110630/src/cmd/ksh93/bltins/read.c.tmoutfix 2011-09-22 09:30:20.421888036 +0200 ++++ ksh-20110630/src/cmd/ksh93/bltins/read.c 2011-09-22 09:31:14.148350534 +0200 +@@ -726,7 +726,7 @@ done: + if(!was_share) + sfset(iop,SF_SHARE,0); + nv_close(np); +- if((flags>>D_FLAG) && (shp->fdstatus[fd]&IOTTY)) ++ if(shp->fdstatus[fd]&IOTTY) + tty_cooked(fd); + if(flags&S_FLAG) + hist_flush(shp->gd->hist_ptr); diff --git a/ksh.spec b/ksh.spec index 6b602d6..f4862c8 100644 --- a/ksh.spec +++ b/ksh.spec @@ -6,7 +6,7 @@ URL: http://www.kornshell.com/ Group: System Environment/Shells License: CPL Version: 20110630 -Release: 3%{?dist} +Release: 4%{?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 Source3: kshrc.rhs @@ -26,6 +26,8 @@ Patch3: ksh-20110630-ifsfix.patch # sent upstream, for ksh <= 2011-08-12 Patch4: ksh-20110630-fixkill.patch +Patch5: ksh-20110630-tmoutfix.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Conflicts: pdksh Requires: coreutils, glibc-common, diffutils @@ -48,6 +50,7 @@ with "sh" (the Bourne Shell). %patch2 -p1 -b .fixregr %patch3 -p1 -b .ifsfix %patch4 -p1 -b .fixkill +%patch5 -p1 -b .tmoutfix #/dev/fd test does not work because of mock sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options @@ -128,6 +131,9 @@ fi rm -rf $RPM_BUILD_ROOT %changelog +* Tue Oct 04 2011 Michal Hlavinka - 20110630-4 +- restore tty settings after timed out read (#572291) + * Fri Aug 12 2011 Michal Hlavinka - 20110630-3 - do not crash when killing last bg job when there is not any