- Fix incorrect $status value of pipelined commands

Resolves: #638955 (Patch by Tomas Smetana <tsmetana@redhat.com>)
This commit is contained in:
Vojtech Vitek (V-Teq) 2010-12-21 10:11:53 +01:00
parent 0463ce5b5b
commit 8cff7251da
2 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,14 @@
diff -up tcsh-6.14.00/sh.proc.c.pipeexec tcsh-6.14.00/sh.proc.c
--- tcsh-6.14.00/sh.proc.c.pipeexec 2010-10-15 10:49:20.647126202 +0200
+++ tcsh-6.14.00/sh.proc.c 2010-10-15 13:25:51.203378381 +0200
@@ -627,6 +627,10 @@ pjwait(pp)
reason = 0;
fp = pp;
do {
+ /* In case of pipelines only the result of the last
+ * command should be taken in account */
+ if ((fp->p_flags & PPOU) || (fp->p_flags & PBACKQ))
+ continue;
if (fp->p_reason)
reason = fp->p_flags & (PSIGNALED | PINTERRUPTED) ?
fp->p_reason | META : fp->p_reason;

View File

@ -3,7 +3,7 @@
Summary: An enhanced version of csh, the C shell
Name: tcsh
Version: 6.17
Release: 9%{?dist}
Release: 10%{?dist}
License: BSD
Group: System Environment/Shells
Source: ftp://ftp.astron.com/pub/tcsh/%{name}-%{version}.00.tar.gz
@ -30,6 +30,8 @@ Patch17: tcsh-6.17.00-testsuite.patch
Patch18: tcsh-6.17.00-extrafork.patch
# Proposed to upstream: http://bugs.gw.com/view.php?id=109
Patch19: tcsh-6.17.00-wait-intr.patch
# Proposed to upstream: http://bugs.gw.com/view.php?id=110
Patch20: tcsh-6.14.00-pipeexit.patch
Provides: csh = %{version}
Requires(post): grep
Requires(postun): coreutils, grep
@ -64,6 +66,7 @@ like syntax.
%patch17 -p1 -b .testsuite
%patch18 -p1 -b .extrafork
%patch19 -p1 -b .wait-intr
%patch20 -p1 -b .pipeexit
for i in Fixes WishList; do
iconv -f iso-8859-1 -t utf-8 "$i" > "${i}_" && \
@ -137,9 +140,11 @@ fi
%{_mandir}/man1/*.1*
%changelog
* Tue Dec 21 2010 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 6.17-10
* Tue Jan 04 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 6.17-10
- Make wait builtin command interruptible
Resolves: #440465
- Fix incorrect $status value of pipelined commands
Resolves: #638955 (Patch by Tomas Smetana <tsmetana@redhat.com>)
* Wed Oct 6 2010 Vitezslav Crhonek <vcrhonek@redhat.com> - 6.17-9
- Remove fork when tcsh processes backquotes