Hello,
as originally requested in Red Hat Bugzilla #445213, I would like to ask
you to add support for DTR/DSR hardware control flow to stty command.
Patch adds the support similar way as existing RTS/CTS hardware control
flow. As the change is pretty small and will affect almost noone, I
didn't added it to NEWS file.

Greetings,
         Ondrej Vasik
>From 1afd7863391e5a8ef8dbfcd007681873137ae3d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= <[email protected]>
Date: Tue, 5 Feb 2013 15:00:47 +0100
Subject: [PATCH] stty: add support for DTR/DSR hardware control flow

Originally requested in Red Hat bugzilla #445213.

* src/stty.c (mode_info): add support for DTR/DSR hardware control flow
* doc/coreutils.texi: document it
* tests/misc/stty.sh: add it to the stty test

---
 doc/coreutils.texi |    7 +++++++
 src/stty.c         |    5 ++++-
 tests/misc/stty.sh |    2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index e29af8b..d5a8a9e 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -13311,6 +13311,13 @@ Disable modem control signals.  May be negated.
 @cindex flow control, hardware
 @cindex RTS/CTS flow control
 Enable RTS/CTS flow control.  Non-POSIX@.  May be negated.
+
+@item cdtrdsr
+@opindex cdtrdsr
+@cindex hardware flow control
+@cindex flow control, hardware
+@cindex DTR/DSR flow control
+Enable DTR/DSR flow control. Non-POSIX@.  May be negated.
 @end table
 
 
diff --git a/src/stty.c b/src/stty.c
index fe0f22f..60d45e2 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -217,7 +217,9 @@ static struct mode_info const mode_info[] =
 #ifdef CRTSCTS
   {"crtscts", control, REV, CRTSCTS, 0},
 #endif
-
+#ifdef CDTRDSR
+  {"cdtrdsr", control, REV, CDTRDSR, 0},
+#endif
   {"ignbrk", input, SANE_UNSET | REV, IGNBRK, 0},
   {"brkint", input, SANE_SET | REV, BRKINT, 0},
   {"ignpar", input, REV, IGNPAR, 0},
@@ -581,6 +583,7 @@ Control settings:\n\
    [-]clocal     disable modem control signals\n\
    [-]cread      allow input to be received\n\
  * [-]crtscts    enable RTS/CTS handshaking\n\
+ * [-]cdtrdsr    enable DTR/DSR handshaking\n\
    csN           set character size to N bits, N in [5..8]\n\
 "), stdout);
       fputs (_("\
diff --git a/tests/misc/stty.sh b/tests/misc/stty.sh
index 0657a74..a0f3878 100755
--- a/tests/misc/stty.sh
+++ b/tests/misc/stty.sh
@@ -52,7 +52,7 @@ for opt in $options; do
   # other serial control settings give the same error. So skip them.
   # Also on ppc*|sparc* glibc platforms 'icanon' gives the same error.
   # See: http://debbugs.gnu.org/7228#14
-  case $opt in parenb|parodd|cstopb|crtscts|icanon) continue;; esac
+  case $opt in parenb|parodd|cstopb|crtscts|icanon|cdtrdsr) continue;; esac
 
   stty $opt || fail=1
 
-- 
1.7.1

Reply via email to