aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-01-24 18:30:35 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-01-24 18:30:35 +0100
commite54cfc5477def68dfe00f39ac0737f4eaeda27e9 (patch)
treec77cbe0e26c0b0cb52cee1179d7cf08bc9e8d8ab
parent7073964b5fc01fbe83eee17e52a2341b19cf11c5 (diff)
downloadbusybox-w32-e54cfc5477def68dfe00f39ac0737f4eaeda27e9.tar.gz
busybox-w32-e54cfc5477def68dfe00f39ac0737f4eaeda27e9.tar.bz2
busybox-w32-e54cfc5477def68dfe00f39ac0737f4eaeda27e9.zip
stty: enable line discipline display and change code if __linix__
function old new delta stty_main 1242 1276 +34 do_display 419 431 +12 display_speed 90 81 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 46/-9) Total: 37 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/stty.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 25c00d1a5..1dd01c4dd 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -1004,8 +1004,9 @@ static void display_speed(const struct termios *mode, int fancy)
1004 const char *fmt_str = "%lu %lu\n\0ispeed %lu baud; ospeed %lu baud;"; 1004 const char *fmt_str = "%lu %lu\n\0ispeed %lu baud; ospeed %lu baud;";
1005 unsigned long ispeed, ospeed; 1005 unsigned long ispeed, ospeed;
1006 1006
1007 ospeed = ispeed = cfgetispeed(mode); 1007 ispeed = cfgetispeed(mode);
1008 if (ispeed == 0 || ispeed == (ospeed = cfgetospeed(mode))) { 1008 ospeed = cfgetospeed(mode);
1009 if (ispeed == 0 || ispeed == ospeed) {
1009 ispeed = ospeed; /* in case ispeed was 0 */ 1010 ispeed = ospeed; /* in case ispeed was 0 */
1010 //________ 0123 4 5 6 7 8 9 1011 //________ 0123 4 5 6 7 8 9
1011 fmt_str = "%lu\n\0\0\0\0\0speed %lu baud;"; 1012 fmt_str = "%lu\n\0\0\0\0\0speed %lu baud;";
@@ -1024,7 +1025,7 @@ static void do_display(const struct termios *mode, int all)
1024 display_speed(mode, 1); 1025 display_speed(mode, 1);
1025 if (all) 1026 if (all)
1026 display_window_size(1); 1027 display_window_size(1);
1027#ifdef HAVE_C_LINE 1028#ifdef __linux__
1028 wrapf("line = %u;\n", mode->c_line); 1029 wrapf("line = %u;\n", mode->c_line);
1029#else 1030#else
1030 newline(); 1031 newline();
@@ -1357,7 +1358,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
1357 } 1358 }
1358 1359
1359 switch (param) { 1360 switch (param) {
1360#ifdef HAVE_C_LINE 1361#ifdef __linux__
1361 case param_line: 1362 case param_line:
1362# ifndef TIOCGWINSZ 1363# ifndef TIOCGWINSZ
1363 xatoul_range_sfx(argnext, 1, INT_MAX, stty_suffixes); 1364 xatoul_range_sfx(argnext, 1, INT_MAX, stty_suffixes);
@@ -1461,7 +1462,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
1461 } 1462 }
1462 1463
1463 switch (param) { 1464 switch (param) {
1464#ifdef HAVE_C_LINE 1465#ifdef __linux__
1465 case param_line: 1466 case param_line:
1466 mode.c_line = xatoul_sfx(argnext, stty_suffixes); 1467 mode.c_line = xatoul_sfx(argnext, stty_suffixes);
1467 stty_state |= STTY_require_set_attr; 1468 stty_state |= STTY_require_set_attr;