[git commit] *: better comments on termios manipulations. No code changes.

Denys Vlasenko vda.linux at googlemail.com
Sun Jan 15 22:00:13 UTC 2012


commit: http://git.busybox.net/busybox/commit/?id=6e8861b5f139cde297a95e785e7c616cf129df80
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 editors/vi.c       |    2 +-
 loginutils/getty.c |    6 ++++--
 util-linux/more.c  |    3 +--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/editors/vi.c b/editors/vi.c
index 6070c48..4a2d5d4 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -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;
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 1f41759..afb411b 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -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
diff --git a/util-linux/more.c b/util-linux/more.c
index efceb71..3595713 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -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);


More information about the busybox-cvs mailing list