]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r241161:
authored <ed@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 11 Nov 2012 12:12:44 +0000 (12:12 +0000)
committered <ed@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 11 Nov 2012 12:12:44 +0000 (12:12 +0000)
commit1544418be8f5be03205f7b09221056509f872b58
tree9bde882a80f4a429c2bf32e3c9f736031dcea59f
parent50466f466c3bd1f94f0863e08803e1350878f2a7
MFC r241161:

  Fix faulty error code handling in read(2) on TTYs.

  When performing a non-blocking read(2), on a TTY while no data is
  available, we should return EAGAIN. But if there's a modem disconnect,
  we should return 0. Right now we only return 0 when doing a blocking
  read, which is wrong.

MFC r242078:

  Correct SIGTTIN handling.

  In the old TTY layer, SIGTTIN was correctly handled like this:

        while (data should be read) {
                send SIGTTIN if not foreground process group
                read data
        }

  In the new TTY layer, however, this behaviour was changed, based on a
  false interpretation of the standard:

        send SIGTTIN if not foreground process group
        while (data should be read) {
                read data
        }

  Correct this by pushing tty_wait_background() into the ttydisc_read_*()
  functions.

  Reported by:  koitsu
  PR:           kern/173010

git-svn-id: svn://svn.freebsd.org/base/stable/9@242892 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/tty.c
sys/kern/tty_ttydisc.c
sys/sys/tty.h