summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2014-01-30 18:17:45 +0000
committerPetter Reinholdtsen <pere@hungry.com>2014-01-30 18:17:45 +0000
commite02ed2ca2ced3060161186ef947b66b08c06d694 (patch)
tree7356a7b4dee6bd615af3fc7c667bce0e38dbc1dd
parenta06f8a26d4e78e4dee9031c972350fc1227cf00a (diff)
downloadipmitool-e02ed2ca2ced3060161186ef947b66b08c06d694.tar.gz
Change serial plugin to only try to disable the IUCLC serial line flag on platforms supporting it. Fixes build problem on Hurd and FreeBSD.
-rw-r--r--ipmitool/src/plugins/serial/serial_basic.c8
-rw-r--r--ipmitool/src/plugins/serial/serial_terminal.c7
2 files changed, 13 insertions, 2 deletions
diff --git a/ipmitool/src/plugins/serial/serial_basic.c b/ipmitool/src/plugins/serial/serial_basic.c
index 55681ab..4b8f112 100644
--- a/ipmitool/src/plugins/serial/serial_basic.c
+++ b/ipmitool/src/plugins/serial/serial_basic.c
@@ -266,8 +266,14 @@ serial_bm_open(struct ipmi_intf * intf)
/* no flow control */
ti.c_cflag &= ~CRTSCTS;
- ti.c_iflag &= ~(IGNBRK | IGNCR | INLCR | ICRNL | IUCLC | INPCK | ISTRIP
+ ti.c_iflag &= ~(IGNBRK | IGNCR | INLCR | ICRNL | INPCK | ISTRIP
| IXON | IXOFF | IXANY);
+#ifdef IUCLC
+ /* Only disable uppercase-to-lowercase mapping on input for
+ platforms supporting the flag. */
+ ti.c_iflag &= ~(IUCLC)
+#endif
+
ti.c_oflag &= ~(OPOST);
ti.c_lflag &= ~(ICANON | ISIG | ECHO | ECHONL | NOFLSH);
diff --git a/ipmitool/src/plugins/serial/serial_terminal.c b/ipmitool/src/plugins/serial/serial_terminal.c
index 10ed942..27413c8 100644
--- a/ipmitool/src/plugins/serial/serial_terminal.c
+++ b/ipmitool/src/plugins/serial/serial_terminal.c
@@ -211,8 +211,13 @@ ipmi_serial_term_open(struct ipmi_intf * intf)
/* no flow control */
ti.c_cflag &= ~CRTSCTS;
- ti.c_iflag &= ~(IGNBRK | IGNCR | INLCR | ICRNL | IUCLC | INPCK | ISTRIP
+ ti.c_iflag &= ~(IGNBRK | IGNCR | INLCR | ICRNL | INPCK | ISTRIP
| IXON | IXOFF | IXANY);
+#ifdef IUCLC
+ /* Only disable uppercase-to-lowercase mapping on input for
+ platforms supporting the flag. */
+ ti.c_iflag &= ~(IUCLC)
+#endif
ti.c_oflag &= ~(OPOST);
ti.c_lflag &= ~(ICANON | ISIG | ECHO | ECHONL | NOFLSH);