summaryrefslogtreecommitdiff
path: root/misc-utils
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-01-21 03:08:39 +0300
committerIgor Pashev <pashev.igor@gmail.com>2012-01-21 03:08:39 +0300
commitad6820fb04d5ed9ade265a7c5813e26c4fb762d5 (patch)
tree1866373eed9fe6de5d547331f68b20398c6eefa5 /misc-utils
parentd2270b07f30fe0ffe22e11d40fb0de2a2bd32e97 (diff)
downloadutil-linux-old-ad6820fb04d5ed9ade265a7c5813e26c4fb762d5.tar.gz
Use static cfmakeraw() if not system
Diffstat (limited to 'misc-utils')
-rw-r--r--misc-utils/script.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/misc-utils/script.c b/misc-utils/script.c
index 9367fafb..2c734c97 100644
--- a/misc-utils/script.c
+++ b/misc-utils/script.c
@@ -67,6 +67,18 @@
#include <utempter.h>
#endif
+#ifndef HAVE_CFMAKERAW
+static void cfmakeraw(struct termios *t) {
+ if (t != NULL) {
+ t->c_iflag &= ~(IMAXBEL|IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+ t->c_oflag &= ~OPOST;
+ t->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+ t->c_cflag &= ~(CSIZE|PARENB);
+ t->c_cflag |= CS8;
+ }
+}
+#endif
+
void finish(int);
void done(void);
void fail(void);