]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
stty: add support for mark/space parity
authorColin Leitner <colin.leitner@googlemail.com>
Sat, 16 Nov 2013 11:14:18 +0000 (12:14 +0100)
committerPádraig Brady <P@draigBrady.com>
Sun, 17 Nov 2013 12:26:12 +0000 (12:26 +0000)
This adds support for using a constant or "stick" parity bit.

* src/stty.c (usage): Mention the new flag.
* tests/misc/stty.sh: Adjust for the new flag.
* NEWS: Mention the improvement.
* docs/coreutils.texi (stty invocation): Mention the new flag.

NEWS
doc/coreutils.texi
src/stty.c
tests/misc/stty.sh

diff --git a/NEWS b/NEWS
index 22fb814853bd25b9d834cf9fc2b203eeb201b387..b6dab624c1ac11b2ce9e9a5648574b672869a9b2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -105,6 +105,8 @@ GNU coreutils NEWS                                    -*- outline -*-
   split --line-bytes=SIZE, now only allocates memory as needed rather
   than allocating SIZE bytes at program start.
 
+  stty now supports configuring "stick" (mark/space) parity where available.
+
 ** Build-related
 
   factor now builds on aarch64 based systems [bug introduced in coreutils-8.20]
index 3ae39d18cbd4a5b6eb1d24949fdb125f9bbacbbc..035f2e67c13b10be92c277a4ed9efb9543b28a5c 100644 (file)
@@ -13792,6 +13792,16 @@ May be negated.
 @cindex even parity
 Set odd parity (even if negated).  May be negated.
 
+@item cmspar
+@opindex cmspar
+@cindex constant parity
+@cindex stick parity
+@cindex mark parity
+@cindex space parity
+Use "stick" (mark/space) parity.  If parodd is set, the parity bit is
+always 1; if parodd is not set, the parity bit is always zero.
+Non-POSIX@.  May be negated.
+
 @item cs5
 @itemx cs6
 @itemx cs7
index e518839d58e08bf1e762563a0304a9c106afd53b..c95217e88cc27adab9c7afaa21efa36fd1675980 100644 (file)
@@ -205,6 +205,9 @@ static struct mode_info const mode_info[] =
 {
   {"parenb", control, REV, PARENB, 0},
   {"parodd", control, REV, PARODD, 0},
+#ifdef CMSPAR
+  {"cmspar", control, REV, CMSPAR, 0},
+#endif
   {"cs5", control, 0, CS5, CSIZE},
   {"cs6", control, 0, CS6, CSIZE},
   {"cs7", control, 0, CS7, CSIZE},
@@ -593,6 +596,7 @@ Control settings:\n\
    [-]hupcl      same as [-]hup\n\
    [-]parenb     generate parity bit in output and expect parity bit in input\n\
    [-]parodd     set odd parity (or even parity with '-')\n\
+ * [-]cmspar     use \"stick\" (mark/space) parity\n\
 "), stdout);
       fputs (_("\
 \n\
index 2f9b9a3b8d588bb139039042a9d2df1146c0b700..8fe759246073744a7e2156909efc582633119e14 100755 (executable)
@@ -52,7 +52,10 @@ 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|cdtrdsr|icanon) continue;; esac
+  case $opt in
+    parenb|parodd|cmspar) continue;;
+    cstopb|crtscts|cdtrdsr|icanon) continue;;
+  esac
 
   stty $opt || fail=1