From: Rick Sladkey (jrs@world.std.com)
Date: 02/12/93


From: jrs@world.std.com (Rick Sladkey)
Subject: Re: Some Linux bugs?
Date: Sat, 13 Feb 1993 00:27:16 GMT


>>>>> On 12 Feb 93 02:32:58 GMT, jenkins@DPW.COM (Colin Jenkins) said:

Colin> Background jobs that redirect stdout and stdin do not get
Colin> stopped immediately upon reading stdin. This can be reproduced
Colin> by running patch (perhaps anything that reads stdin) with a
Colin> patch file that cannot find its target files to patch. In my
Colin> case this was:

Colin> /usr/src/linux/QIC-02/tpqic02-2d=> patch <tpqic02.pat 1 >& /tmp/out &

No, not anything that reads stdin. Only a program that reads /dev/tty.
Here is a simpler way to repoduce the problem:

$ cat /dev/tty &

Here is a patch.
=====
*** linux/kernel/chr_drv/tty_io.c.orig Tue Feb 9 15:08:00 1993
--- linux/kernel/chr_drv/tty_io.c Fri Feb 12 18:46:57 1993
***************
*** 819,827 ****
        tty = TTY_TABLE(dev);
        if (!tty || (tty->flags & (1 << TTY_IO_ERROR)))
                return -EIO;
! if (MINOR(inode->i_rdev) && (tty->pgrp > 0) &&
! (current->tty == dev) &&
! (tty->pgrp != current->pgrp))
                if (is_ignored(SIGTTIN) || is_orphaned_pgrp(current->pgrp))
                        return -EIO;
                else {
--- 819,827 ----
        tty = TTY_TABLE(dev);
        if (!tty || (tty->flags & (1 << TTY_IO_ERROR)))
                return -EIO;
! if ((MAJOR(inode->i_rdev) != 4 || MINOR(inode->i_rdev) != 0)
! && (tty->pgrp > 0) && (current->tty == dev)
! && (tty->pgrp != current->pgrp))
                if (is_ignored(SIGTTIN) || is_orphaned_pgrp(current->pgrp))
                        return -EIO;
                else {