--- old/sh/subshell.c	Tue Jul 22 15:16:29 2014
+++ new/sh/subshell.c	Wed Aug  6 17:45:15 2014
@@ -523,11 +523,7 @@
 	if(!shp->subshare)
 		sp->pathlist = path_dup((Pathcomp_t*)shp->pathlist);
 	if(comsub)
-	{
 		shp->comsub = comsub;
-		if(comsub==1 && !(pipefail=sh_isoption(shp,SH_PIPEFAIL)))
-			sh_onoption(shp,SH_PIPEFAIL);
-	}
 	sp->shpwdfd=-1;
 	if(!comsub || !shp->subshare)
 	{
@@ -645,8 +641,6 @@
 					shp->spid = 0;
 				shp->pipepid = 0;
 			}
-			else if(comsub==1 && !pipefail)
-				sh_offoption(shp,SH_PIPEFAIL);
 			/* move tmp file to iop and restore sfstdout */
 			iop = sfswap(sfstdout,NIL(Sfio_t*));
 			if(!iop)
--- old/sh/xec.c	Sat Jul 26 07:55:51 2014
+++ new/sh/xec.c	Wed Aug  6 17:19:07 2014
@@ -1982,7 +1992,7 @@
 				if(!(type&SH_EXITSIG))
 				{
 					/* wait for remainder of pipline */
-					if(shp->pipepid>1)
+					if(shp->pipepid>1 && shp->comsub!=1)
 					{
 						job_wait(shp->pipepid);
 						type = shp->exitval;
