*: better comments on termios manipulations. No code changes.
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 15 Jan 2012 22:00:13 +0000 (23:00 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 15 Jan 2012 22:00:13 +0000 (23:00 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
editors/vi.c
loginutils/getty.c
util-linux/more.c

index 6070c48d26d1f283f8aee16af53d4e2835d852f8..4a2d5d4f11219a34be26b4812d8fdec6fb10e118 100644 (file)
@@ -2304,7 +2304,7 @@ static void rawmode(void)
 {
        tcgetattr(0, &term_orig);
        term_vi = term_orig;
-       term_vi.c_lflag &= (~ICANON & ~ECHO);   // leave ISIG ON- allow intr's
+       term_vi.c_lflag &= (~ICANON & ~ECHO);   // leave ISIG on - allow intr's
        term_vi.c_iflag &= (~IXON & ~ICRNL);
        term_vi.c_oflag &= (~ONLCR);
        term_vi.c_cc[VMIN] = 1;
index 1f417591bdb104796f4f2dcec84694f4ddc77a6a..afb411b981f593c3fea6d6d3fd8b5cfcd1e8be03 100644 (file)
@@ -294,8 +294,10 @@ static void init_tty_attrs(int speed)
        /* non-raw output; add CR to each NL */
        G.tty_attrs.c_oflag = OPOST | ONLCR;
 
-       G.tty_attrs.c_cc[VMIN] = 1; /* block reads if < 1 char is available */
-       G.tty_attrs.c_cc[VTIME] = 0; /* no timeout (reads block forever) */
+       /* reads would block only if < 1 char is available */
+       G.tty_attrs.c_cc[VMIN] = 1;
+       /* no timeout (reads block forever) */
+       G.tty_attrs.c_cc[VTIME] = 0;
 #ifdef __linux__
        G.tty_attrs.c_line = 0;
 #endif
index efceb71ec14a576a7d5aa6c9f7e6ef925eb3c572..35957139711f20b89b3c5b793b66f5ccc9a1af0f 100644 (file)
@@ -85,8 +85,7 @@ int more_main(int argc UNUSED_PARAM, char **argv)
                cin_fileno = fileno(cin);
                getTermSettings(cin_fileno, &initial_settings);
                new_settings = initial_settings;
-               new_settings.c_lflag &= ~ICANON;
-               new_settings.c_lflag &= ~ECHO;
+               new_settings.c_lflag &= ~(ICANON | ECHO);
                new_settings.c_cc[VMIN] = 1;
                new_settings.c_cc[VTIME] = 0;
                setTermSettings(cin_fileno, &new_settings);