summaryrefslogtreecommitdiff
path: root/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.32-n_tty-honor-opost-flag-for-echoes.patch
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-01-26 15:59:18 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-01-26 15:59:18 +0000
commit684d263e75a6a7ede638afa60e35a238e24c12ba (patch)
tree5ab1d38848909494b693e31d0a29659bcaa365e4 /meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.32-n_tty-honor-opost-flag-for-echoes.patch
parent3a32c2c6e9d1d9823971a17c0ee8f8839bd79b1f (diff)
downloadopenembedded-core-684d263e75a6a7ede638afa60e35a238e24c12ba.tar.gz
openembedded-core-684d263e75a6a7ede638afa60e35a238e24c12ba.tar.bz2
openembedded-core-684d263e75a6a7ede638afa60e35a238e24c12ba.tar.xz
openembedded-core-684d263e75a6a7ede638afa60e35a238e24c12ba.zip
linux-moblin: Add 2.6.31.5
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.32-n_tty-honor-opost-flag-for-echoes.patch')
-rw-r--r--meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.32-n_tty-honor-opost-flag-for-echoes.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.32-n_tty-honor-opost-flag-for-echoes.patch b/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.32-n_tty-honor-opost-flag-for-echoes.patch
new file mode 100644
index 000000000..216fca7a2
--- /dev/null
+++ b/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.32-n_tty-honor-opost-flag-for-echoes.patch
@@ -0,0 +1,86 @@
+commit ee5aa7b8b98774f408d20a2f61f97a89ac66c29b
+Author: Joe Peterson <joe@skyrush.com>
+Date: Wed Sep 9 15:03:13 2009 -0600
+
+ n_tty: honor opost flag for echoes
+
+ Fixes the following bug:
+
+ http://bugs.linuxbase.org/show_bug.cgi?id=2692
+
+ Causes processing of echoed characters (output from the echo buffer) to
+ honor the O_OPOST flag, which is consistent with the old behavior.
+
+ Note that this and the next patch ("n_tty: move echoctl check and
+ clean up logic") were verified together by the bug reporters, and
+ the test now passes.
+
+ Signed-off-by: Joe Peterson <joe@skyrush.com>
+ Cc: Linux Torvalds <torvalds@linux-foundation.org>
+ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
+index 4e28b35..e6eeeb2 100644
+--- a/drivers/char/n_tty.c
++++ b/drivers/char/n_tty.c
+@@ -272,7 +272,8 @@ static inline int is_continuation(unsigned char c, struct tty_struct *tty)
+ *
+ * This is a helper function that handles one output character
+ * (including special characters like TAB, CR, LF, etc.),
+- * putting the results in the tty driver's write buffer.
++ * doing OPOST processing and putting the results in the
++ * tty driver's write buffer.
+ *
+ * Note that Linux currently ignores TABDLY, CRDLY, VTDLY, FFDLY
+ * and NLDLY. They simply aren't relevant in the world today.
+@@ -350,8 +351,9 @@ static int do_output_char(unsigned char c, struct tty_struct *tty, int space)
+ * @c: character (or partial unicode symbol)
+ * @tty: terminal device
+ *
+- * Perform OPOST processing. Returns -1 when the output device is
+- * full and the character must be retried.
++ * Output one character with OPOST processing.
++ * Returns -1 when the output device is full and the character
++ * must be retried.
+ *
+ * Locking: output_lock to protect column state and space left
+ * (also, this is called from n_tty_write under the
+@@ -377,8 +379,11 @@ static int process_output(unsigned char c, struct tty_struct *tty)
+ /**
+ * process_output_block - block post processor
+ * @tty: terminal device
+- * @inbuf: user buffer
+- * @nr: number of bytes
++ * @buf: character buffer
++ * @nr: number of bytes to output
++ *
++ * Output a block of characters with OPOST processing.
++ * Returns the number of characters output.
+ *
+ * This path is used to speed up block console writes, among other
+ * things when processing blocks of output data. It handles only
+@@ -605,12 +610,18 @@ static void process_echoes(struct tty_struct *tty)
+ if (no_space_left)
+ break;
+ } else {
+- int retval;
+-
+- retval = do_output_char(c, tty, space);
+- if (retval < 0)
+- break;
+- space -= retval;
++ if (O_OPOST(tty) &&
++ !(test_bit(TTY_HW_COOK_OUT, &tty->flags))) {
++ int retval = do_output_char(c, tty, space);
++ if (retval < 0)
++ break;
++ space -= retval;
++ } else {
++ if (!space)
++ break;
++ tty_put_char(tty, c);
++ space -= 1;
++ }
+ cp += 1;
+ nr -= 1;
+ }