Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113446
b: refs/heads/master
c: 95f9bfc
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Oct 13, 2008
1 parent e0c5c72 commit 37f286e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 452a00d2ee288f2cbc36f676edd06cb14d2878c1
refs/heads/master: 95f9bfc6b76e862265a2d70ae061eec18fe14140
25 changes: 25 additions & 0 deletions trunk/drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,31 @@ static inline ssize_t do_tty_write(
return ret;
}

/**
* tty_write_message - write a message to a certain tty, not just the console.
* @tty: the destination tty_struct
* @msg: the message to write
*
* This is used for messages that need to be redirected to a specific tty.
* We don't put it into the syslog queue right now maybe in the future if
* really needed.
*
* We must still hold the BKL and test the CLOSING flag for the moment.
*/

void tty_write_message(struct tty_struct *tty, char *msg)
{
lock_kernel();
if (tty) {
mutex_lock(&tty->atomic_write_lock);
if (tty->ops->write && !test_bit(TTY_CLOSING, &tty->flags))
tty->ops->write(tty, msg, strlen(msg));
tty_write_unlock(tty);
}
unlock_kernel();
return;
}


/**
* tty_write - write method for tty device file
Expand Down
16 changes: 0 additions & 16 deletions trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1291,22 +1291,6 @@ static int __init disable_boot_consoles(void)
}
late_initcall(disable_boot_consoles);

/**
* tty_write_message - write a message to a certain tty, not just the console.
* @tty: the destination tty_struct
* @msg: the message to write
*
* This is used for messages that need to be redirected to a specific tty.
* We don't put it into the syslog queue right now maybe in the future if
* really needed.
*/
void tty_write_message(struct tty_struct *tty, char *msg)
{
if (tty && tty->ops->write)
tty->ops->write(tty, msg, strlen(msg));
return;
}

#if defined CONFIG_PRINTK

/*
Expand Down

0 comments on commit 37f286e

Please sign in to comment.