diff options
author | Denys Vlasenko | 2011-01-24 18:30:35 +0100 |
---|---|---|
committer | Denys Vlasenko | 2011-01-24 18:30:35 +0100 |
commit | e54cfc5477def68dfe00f39ac0737f4eaeda27e9 (patch) | |
tree | c77cbe0e26c0b0cb52cee1179d7cf08bc9e8d8ab /coreutils/stty.c | |
parent | 7073964b5fc01fbe83eee17e52a2341b19cf11c5 (diff) | |
download | busybox-e54cfc5477def68dfe00f39ac0737f4eaeda27e9.zip busybox-e54cfc5477def68dfe00f39ac0737f4eaeda27e9.tar.gz |
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>
Diffstat (limited to 'coreutils/stty.c')
-rw-r--r-- | coreutils/stty.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c index 25c00d1..1dd01c4 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -1004,8 +1004,9 @@ static void display_speed(const struct termios *mode, int fancy) const char *fmt_str = "%lu %lu\n\0ispeed %lu baud; ospeed %lu baud;"; unsigned long ispeed, ospeed; - ospeed = ispeed = cfgetispeed(mode); - if (ispeed == 0 || ispeed == (ospeed = cfgetospeed(mode))) { + ispeed = cfgetispeed(mode); + ospeed = cfgetospeed(mode); + if (ispeed == 0 || ispeed == ospeed) { ispeed = ospeed; /* in case ispeed was 0 */ //________ 0123 4 5 6 7 8 9 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) display_speed(mode, 1); if (all) display_window_size(1); -#ifdef HAVE_C_LINE +#ifdef __linux__ wrapf("line = %u;\n", mode->c_line); #else newline(); @@ -1357,7 +1358,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv) } switch (param) { -#ifdef HAVE_C_LINE +#ifdef __linux__ case param_line: # ifndef TIOCGWINSZ xatoul_range_sfx(argnext, 1, INT_MAX, stty_suffixes); @@ -1461,7 +1462,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv) } switch (param) { -#ifdef HAVE_C_LINE +#ifdef __linux__ case param_line: mode.c_line = xatoul_sfx(argnext, stty_suffixes); stty_state |= STTY_require_set_attr; |