361f26
diff -up ksh-20120801/src/cmd/ksh93/sh/xec.c.mtty ksh-20120801/src/cmd/ksh93/sh/xec.c
bc9e18
--- ksh-20120801/src/cmd/ksh93/sh/xec.c.mtty	2014-01-22 16:52:06.441608750 +0100
bc9e18
+++ ksh-20120801/src/cmd/ksh93/sh/xec.c	2014-01-22 16:52:06.485608361 +0100
bc9e18
@@ -3163,7 +3169,7 @@ pid_t _sh_fork(Shell_t *shp,register pid
361f26
 			 * completed.  Make parent the job group id.
361f26
 			 */
361f26
 			if(postid==0)
361f26
-				job.curpgid = parent;
84b019
+				job.curpgid = job.jobcontrol?parent:getpid();
361f26
 			if(job.jobcontrol || (flags&FAMP))
361f26
 			{
361f26
 				if(setpgid(parent,job.curpgid)<0 && errno==EPERM)