summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Vašík <ovasik@redhat.com>2013-02-05 15:00:47 +0100
committerPádraig Brady <P@draigBrady.com>2013-02-05 16:05:54 +0000
commit4b84062d66d395be290312053701e6d11cd3d9cc (patch)
treea1f2915fd7362aa1b869e972af4a7cccf5a55f73
parent51b3ba842d1196f165e242d77e1d5f092d3b840d (diff)
downloadcoreutils-4b84062d66d395be290312053701e6d11cd3d9cc.tar.xz
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 flow control, if available. * doc/coreutils.texi: Document it. * tests/misc/stty.sh: Add it to the list of serial options to avoid. * NEWS: Mention the improvement.
-rw-r--r--NEWS1
-rw-r--r--doc/coreutils.texi7
-rw-r--r--src/stty.c4
-rwxr-xr-xtests/misc/stty.sh2
4 files changed, 13 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index f3af75c3e..51b7a82f0 100644
--- a/NEWS
+++ b/NEWS
@@ -90,6 +90,7 @@ GNU coreutils NEWS -*- outline -*-
stat and tail now know about CEPH. stat -f --format=%T now reports the file
system type, and tail -f uses polling for files on CEPH file systems.
+ stty now supports configuring DTR/DSR hardware flow control where available.
** Build-related
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index e248af0e2..faed80d61 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -13635,6 +13635,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 fe0f22f8f..ee891a593 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -217,6 +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},
@@ -581,6 +584,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 0657a7472..2f9b9a3b8 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|cdtrdsr|icanon) continue;; esac
stty $opt || fail=1