aboutsummaryrefslogtreecommitdiff
path: root/coreutils/stty.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/stty.c')
-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;