diff options
Diffstat (limited to 'drivers/char/tty_ioctl.c')
-rw-r--r-- | drivers/char/tty_ioctl.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 02f42ec87..21c09384e 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c @@ -60,7 +60,7 @@ void tty_wait_until_sent(struct tty_struct * tty, int timeout) printk("waiting %s...(%d)\n", tty_name(tty), tty->driver.chars_in_buffer(tty)); #endif current->state = TASK_INTERRUPTIBLE; - if (current->signal & ~current->blocked) + if (signal_pending(current)) goto stop_waiting; if (!tty->driver.chars_in_buffer(tty)) break; @@ -170,7 +170,7 @@ static int set_termios(struct tty_struct * tty, unsigned long arg, int opt) if (opt & TERMIOS_WAIT) { tty_wait_until_sent(tty, 0); - if (current->signal & ~current->blocked) + if (signal_pending(current)) return -EINTR; } @@ -509,18 +509,15 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, tty->packet = 0; return 0; } - /* These two ioctl's always return success; even if */ - /* the driver doesn't support them. */ - case TCSBRK: case TCSBRKP: - retval = tty_check_change(tty); + case TIOCGSOFTCAR: + return put_user(C_CLOCAL(tty) ? 1 : 0, (int *) arg); + case TIOCSSOFTCAR: + retval = get_user(arg, (unsigned int *) arg); if (retval) return retval; - tty_wait_until_sent(tty, 0); - if (current->signal & ~current->blocked) - return -EINTR; - if (!tty->driver.ioctl) - return 0; - tty->driver.ioctl(tty, file, cmd, arg); + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | + (arg ? CLOCAL : 0)); return 0; default: return -ENOIOCTLCMD; |