diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-01-28 15:30:32 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-01-28 15:30:32 +0100 |
commit | 41ca5d4e9be11ea6ae040b51d9628a189fd82896 (patch) | |
tree | f9c35cc37b9622f6cccd91b94548f44b9a534029 /drivers/tty/tty_io.c | |
parent | 0fcedc8631ec28ca25d3c0b116e8fa0c19dd5f6d (diff) | |
parent | 3669ef9fa7d35f573ec9c0e0341b29251c2734a7 (diff) |
Merge commit 3669ef9fa7d3 ("x86, tls: Interpret an all-zero struct user_desc as 'no segment'") into x86/asm
Pick up the latestest asm fixes before advancing it any further.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r-- | drivers/tty/tty_io.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 4f35b43e247..51f066aa375 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -1464,6 +1464,9 @@ static int tty_reopen(struct tty_struct *tty) driver->subtype == PTY_TYPE_MASTER) return -EIO; + if (test_bit(TTY_EXCLUSIVE, &tty->flags) && !capable(CAP_SYS_ADMIN)) + return -EBUSY; + tty->count++; WARN_ON(!tty->ldisc); @@ -2106,10 +2109,6 @@ retry_open: retval = -ENODEV; filp->f_flags = saved_flags; - if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) && - !capable(CAP_SYS_ADMIN)) - retval = -EBUSY; - if (retval) { #ifdef TTY_DEBUG_HANGUP printk(KERN_DEBUG "%s: error %d in opening %s...\n", __func__, |