diff for duplicates of <4F927804.4090208@suse.cz> diff --git a/a/1.txt b/N1/1.txt index 607eb42..89ad41c 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -11,7 +11,7 @@ Date: Tue Jun 22 10:14:49 2010 -0700 tty: Add EXTPROC support for LINEMODE -== +==== The code is now: @@ -21,15 +21,15 @@ tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n); spin_lock_irqsave(&tty->read_lock, flags); tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1); tty->read_cnt -= n; -if (L_EXTPROC(tty) && tty->icanon && n = 1) { - if (!tty->read_cnt && (*b)[n-1] = EOF_CHAR(tty)) +if (L_EXTPROC(tty) && tty->icanon && n == 1) { + if (!tty->read_cnt && (*b)[n-1] == EOF_CHAR(tty)) n--; } -== +==== n after "n -= retval" means number of successfully copied chars. So the -test "n = 1" along with "!tty->read_cnt" actually should ensure we +test "n == 1" along with "!tty->read_cnt" actually should ensure we copied everything and that is exactly one char. Further we test if that one is EOF. If so, ignore that char by pretending we copied nothing. @@ -60,15 +60,15 @@ In any case the wrapped buffer is still to be fixed... (Or ignored.) retval = copy_to_user(*b, &tty->read_buf[tty->read_tail], n); n -= retval; -+ is_eof = n = 1 && -+ tty->read_buf[tty->read_tail] = EOF_CHAR(tty); ++ is_eof = n == 1 && ++ tty->read_buf[tty->read_tail] == EOF_CHAR(tty); tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n); spin_lock_irqsave(&tty->read_lock, flags); tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1); tty->read_cnt -= n; /* Turn single EOF into zero-length read */ -- if (L_EXTPROC(tty) && tty->icanon && n = 1) { -- if (!tty->read_cnt && (*b)[n-1] = EOF_CHAR(tty)) +- if (L_EXTPROC(tty) && tty->icanon && n == 1) { +- if (!tty->read_cnt && (*b)[n-1] == EOF_CHAR(tty)) - n--; - } + if (L_EXTPROC(tty) && tty->icanon && is_eof && diff --git a/a/content_digest b/N1/content_digest index 0d60b38..88edeb8 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -2,7 +2,7 @@ "ref\020120420220010.0fa29bee@pyramind.ukuu.org.uk\0" "From\0Jiri Slaby <jslaby@suse.cz>\0" "Subject\0Re: [PATCH] drivers/tty: Use get_user instead of dereferencing user pointer\0" - "Date\0Sat, 21 Apr 2012 09:04:04 +0000\0" + "Date\0Sat, 21 Apr 2012 11:04:04 +0200\0" "To\0Alan Cox <alan@lxorguk.ukuu.org.uk>\0" "Cc\0Emil Goode <emilgoode@gmail.com>" gregkh@linuxfoundation.org @@ -25,7 +25,7 @@ "\n" " tty: Add EXTPROC support for LINEMODE\n" "\n" - "==\n" + "====\n" "\n" "The code is now:\n" "\n" @@ -35,15 +35,15 @@ "spin_lock_irqsave(&tty->read_lock, flags);\n" "tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1);\n" "tty->read_cnt -= n;\n" - "if (L_EXTPROC(tty) && tty->icanon && n = 1) {\n" - " if (!tty->read_cnt && (*b)[n-1] = EOF_CHAR(tty))\n" + "if (L_EXTPROC(tty) && tty->icanon && n == 1) {\n" + " if (!tty->read_cnt && (*b)[n-1] == EOF_CHAR(tty))\n" " n--;\n" "}\n" "\n" - "==\n" + "====\n" "\n" "n after \"n -= retval\" means number of successfully copied chars. So the\n" - "test \"n = 1\" along with \"!tty->read_cnt\" actually should ensure we\n" + "test \"n == 1\" along with \"!tty->read_cnt\" actually should ensure we\n" "copied everything and that is exactly one char. Further we test if that\n" "one is EOF. If so, ignore that char by pretending we copied nothing.\n" "\n" @@ -74,15 +74,15 @@ " retval = copy_to_user(*b,\n" "&tty->read_buf[tty->read_tail], n);\n" " n -= retval;\n" - "+ is_eof = n = 1 &&\n" - "+ tty->read_buf[tty->read_tail] = EOF_CHAR(tty);\n" + "+ is_eof = n == 1 &&\n" + "+ tty->read_buf[tty->read_tail] == EOF_CHAR(tty);\n" " tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n);\n" " spin_lock_irqsave(&tty->read_lock, flags);\n" " tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1);\n" " tty->read_cnt -= n;\n" " /* Turn single EOF into zero-length read */\n" - "- if (L_EXTPROC(tty) && tty->icanon && n = 1) {\n" - "- if (!tty->read_cnt && (*b)[n-1] = EOF_CHAR(tty))\n" + "- if (L_EXTPROC(tty) && tty->icanon && n == 1) {\n" + "- if (!tty->read_cnt && (*b)[n-1] == EOF_CHAR(tty))\n" "- n--;\n" "- }\n" "+ if (L_EXTPROC(tty) && tty->icanon && is_eof &&\n" @@ -97,4 +97,4 @@ "js\n" suse labs -81f07dea7856a1caa41e9b4d31aa564b249a242fdc47ed778a2d4c413ae88130 +bed9ba0278e881d49f9edcc397680caa44af0e6ec48617e0cba7ffea856bb02d
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.