summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1997-01-06 01:26:44 +0000
committersteve <steve@FreeBSD.org>1997-01-06 01:26:44 +0000
commit774419801bc39ff806459ffb263dc85bcb1e48a5 (patch)
treec989ea6ac648c652bc3a34b5ad3bb8d48a86520d /bin
parent9c95df7455d9e3da57c563478e2b6331567ff613 (diff)
downloadFreeBSD-src-774419801bc39ff806459ffb263dc85bcb1e48a5.zip
FreeBSD-src-774419801bc39ff806459ffb263dc85bcb1e48a5.tar.gz
Fix a problem that caused some foreground pipelines to die with:
tcsetpgrp failed, errno=1 Discovered and Reviewed by: joerg
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/jobs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index b57b870..974e6dc 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: jobs.c,v 1.8 1996/10/16 02:30:39 steve Exp $
+ * $Id: jobs.c,v 1.9 1996/12/14 06:19:18 steve Exp $
*/
#ifndef lint
@@ -600,8 +600,7 @@ forkshell(jp, n, mode)
pgrp = getpid();
else
pgrp = jp->ps[0].pid;
- setpgid(0, pgrp);
- if (mode == FORK_FG) {
+ if (setpgid(0, pgrp) == 0 && mode == FORK_FG) {
/*** this causes superfluous TIOCSPGRPS ***/
#ifdef OLD_TTY_DRIVER
if (ioctl(2, TIOCSPGRP, (char *)&pgrp) < 0)
OpenPOWER on IntegriCloud