tcsh/tcsh-6.14.00-pipeexit.patch
Vojtech Vitek (V-Teq) 8cff7251da - Fix incorrect $status value of pipelined commands
Resolves: #638955 (Patch by Tomas Smetana <tsmetana@redhat.com>)
2011-01-04 16:15:16 +01:00

15 lines
556 B
Diff

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;