summaryrefslogtreecommitdiff
path: root/ace/TTY_IO.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1999-06-01 15:43:56 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1999-06-01 15:43:56 +0000
commitf40367b32a89d21781b36682cae49ef0571ba94e (patch)
treedb23b4bd8a3bdc94082b13f5a54474d631823bad /ace/TTY_IO.cpp
parent1e0bc2c3cccefec6b9a661694e8f6ff45a67ebfb (diff)
downloadATCD-f40367b32a89d21781b36682cae49ef0571ba94e.tar.gz
.
Diffstat (limited to 'ace/TTY_IO.cpp')
-rw-r--r--ace/TTY_IO.cpp48
1 files changed, 30 insertions, 18 deletions
diff --git a/ace/TTY_IO.cpp b/ace/TTY_IO.cpp
index a18aec92f2f..e23da75550e 100644
--- a/ace/TTY_IO.cpp
+++ b/ace/TTY_IO.cpp
@@ -36,64 +36,76 @@ ACE_TTY_IO::control (Control_Mode cmd,
// Get default device parameters.
-#if defined(TCGETS)
+#if defined (TCGETS)
if (this->ACE_IO_SAP::control (TCGETS, (void *) &devpar) == -1)
-#elif defined(TCGETA)
+#elif defined (TCGETA)
if (this->ACE_IO_SAP::control (TCGETA, (void *) &devpar) == -1)
#else
errno = ENOSYS;
-#endif
+#endif /* TCGETS */
return -1;
+ u_int newbaudrate = 0;
+
switch (cmd)
{
case SETPARAMS:
switch (arg->baudrate)
{
case 300:
- c_cflag |= B300;
+ newbaudrate = B300;
break;
case 600:
- c_cflag |= B600;
+ newbaudrate = B600;
break;
case 1200:
- c_cflag |= B1200;
+ newbaudrate = B1200;
break;
case 2400:
- c_cflag |= B2400;
+ newbaudrate = B2400;
break;
case 4800:
- c_cflag |= B4800;
+ newbaudrate = B4800;
break;
case 9600:
- c_cflag |= B9600;
+ newbaudrate = B9600;
break;
case 19200:
- c_cflag |= B19200;
+ newbaudrate = B19200;
break;
case 38400:
- c_cflag |= B38400;
+ newbaudrate = B38400;
break;
-#if 0
+#if defined (ACE_USES_HIGH_BAUD_RATES)
case 56000:
- c_cflag |= B56000;
+ newbaudrate = B56000;
break;
case 57600:
- c_cflag |= B57600;
+ newbaudrate = B57600;
break;
case 115200:
- c_cflag |= B115200;
+ newbaudrate = B115200;
break;
case 128000:
- c_cflag |= B128000;
+ newbaudrate = B128000;
break;
case 256000:
- c_cflag |= B256000;
+ newbaudrate = B256000;
break;
-#endif /* 0 */
+#endif /* ACE_USES_HIGH_BAUD_RATES */
default:
return -1;
}
+
+#if defined(ACE_USES_OLD_TERMIOS_STRUCT)
+ // @@ Can you really have different input and output baud
+ // rates?!
+ devpar.c_ispeed = newbaudrate;
+ devpar.c_ospeed = newbaudrate;
+#else
+ c_cflag |= newbaudrate;
+#endif /* ACE_USES_OLD_TERMIOS_STRUCT */
+
switch (arg->databits)
{
case 5: