diff for duplicates of <4F92BE52.4020908@symas.com> diff --git a/a/1.txt b/N1/1.txt index 77cdf54..98dca09 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -12,7 +12,7 @@ Jiri Slaby wrote: > > tty: Add EXTPROC support for LINEMODE > -> == +> ==== > > The code is now: > @@ -22,15 +22,15 @@ Jiri Slaby wrote: > 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. @@ -67,15 +67,15 @@ returned from the read. > 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 fe46f02..b03615d 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -3,7 +3,7 @@ "ref\04F927804.4090208@suse.cz\0" "From\0Howard Chu <hyc@symas.com>\0" "Subject\0Re: [PATCH] drivers/tty: Use get_user instead of dereferencing user pointer\0" - "Date\0Sat, 21 Apr 2012 14:04:02 +0000\0" + "Date\0Sat, 21 Apr 2012 07:04:02 -0700\0" "To\0Jiri Slaby <jslaby@suse.cz>\0" "Cc\0Alan Cox <alan@lxorguk.ukuu.org.uk>" Emil Goode <emilgoode@gmail.com> @@ -27,7 +27,7 @@ ">\n" "> tty: Add EXTPROC support for LINEMODE\n" ">\n" - "> ==\n" + "> ====\n" ">\n" "> The code is now:\n" ">\n" @@ -37,15 +37,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" @@ -82,15 +82,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" @@ -109,4 +109,4 @@ " Director, Highland Sun http://highlandsun.com/hyc/\n" Chief Architect, OpenLDAP http://www.openldap.org/project/ -cd4ccd555d81336b58111da1b2d3290732bb78d97526b874007eb03fa08e96be +1d2680aa4db0bf4d8aebbc25836432b3793f02a4ac14c235fe6d0b33ef19ac93
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.