struct pid *tty_pgrp = tty_get_pgrp(tty);
if (tty_pgrp) {
kill_pgrp(tty_pgrp, SIGHUP, on_exit);
- if (!on_exit)
- kill_pgrp(tty_pgrp, SIGCONT, on_exit);
+ kill_pgrp(tty_pgrp, SIGCONT, on_exit);
put_pid(tty_pgrp);
}
}
*
* Locking: None
*/
-static ssize_t tty_line_name(struct tty_driver *driver, int index, char *p)
+static void tty_line_name(struct tty_driver *driver, int index, char *p)
{
if (driver->flags & TTY_DRIVER_UNNUMBERED_NODE)
- return sprintf(p, "%s", driver->name);
+ strcpy(p, driver->name);
else
- return sprintf(p, "%s%d", driver->name,
- index + driver->name_base);
+ sprintf(p, "%s%d", driver->name, index + driver->name_base);
}
/**
tty_free_termios(tty);
tty_driver_remove_tty(tty->driver, tty);
tty->port->itty = NULL;
- if (tty->link)
- tty->link->port->itty = NULL;
cancel_work_sync(&tty->port->buf.work);
if (tty->link)
int pty_master, tty_closing, o_tty_closing, do_sleep;
int idx;
char buf[64];
- long timeout = 0;
if (tty_paranoia_check(tty, inode, __func__))
return 0;
__func__, tty_name(tty, buf));
tty_unlock_pair(tty, o_tty);
mutex_unlock(&tty_mutex);
- schedule_timeout_killable(timeout);
- if (timeout < 120 * HZ)
- timeout = 2 * timeout + 1;
- else
- timeout = MAX_SCHEDULE_TIMEOUT;
+ schedule();
}
/*
if (i >= ARRAY_SIZE(cs))
break;
}
- while (i--) {
- int index = cs[i]->index;
- struct tty_driver *drv = cs[i]->device(cs[i], &index);
-
- /* don't resolve tty0 as some programs depend on it */
- if (drv && (cs[i]->index > 0 || drv->major != TTY_MAJOR))
- count += tty_line_name(drv, index, buf + count);
- else
- count += sprintf(buf + count, "%s%d",
- cs[i]->name, cs[i]->index);
-
- count += sprintf(buf + count, "%c", i ? ' ':'\n');
- }
+ while (i--)
+ count += sprintf(buf + count, "%s%d%c",
+ cs[i]->name, cs[i]->index, i ? ' ':'\n');
console_unlock();
return count;