summaryrefslogtreecommitdiff
path: root/usr.bin/tip/cmds.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-06-06 23:24:53 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-06-06 23:24:53 +0000
commit6e0ac5008146992124736a29366268c9cfa4b9e0 (patch)
tree6aa557db083520f4e51b524f983c8f4451dd05f3 /usr.bin/tip/cmds.c
parentee2af0491a5327330de1729a7d335bae56ff35cc (diff)
teach tip about line disciplines; tried by mbalmer too
Diffstat (limited to 'usr.bin/tip/cmds.c')
-rw-r--r--usr.bin/tip/cmds.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/usr.bin/tip/cmds.c b/usr.bin/tip/cmds.c
index 60f903acc1e..c03934689a3 100644
--- a/usr.bin/tip/cmds.c
+++ b/usr.bin/tip/cmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmds.c,v 1.25 2006/03/17 19:39:46 deraadt Exp $ */
+/* $OpenBSD: cmds.c,v 1.26 2006/06/06 23:24:52 deraadt Exp $ */
/* $NetBSD: cmds.c,v 1.7 1997/02/11 09:24:03 mrg Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: cmds.c,v 1.25 2006/03/17 19:39:46 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: cmds.c,v 1.26 2006/06/06 23:24:52 deraadt Exp $";
#endif /* not lint */
#include "tip.h"
@@ -64,6 +64,7 @@ static int args(char *, char **, int);
static void prtime(char *, time_t);
static void tandem(char *);
static void hardwareflow(char *);
+void linedisc(char *);
static int anyof(char *, char *);
/*
@@ -789,6 +790,10 @@ variable(int c)
else
hardwareflow("off");
}
+ if (vtable[LINEDISC].v_access&CHANGED) {
+ vtable[LINEDISC].v_access &= ~CHANGED;
+ linedisc(NOSTR);
+ }
}
/*ARGSUSED*/
@@ -863,6 +868,17 @@ hardwareflow(char *option)
}
/*
+ * Change line discipline to the specified one.
+ */
+void
+linedisc(char *option)
+{
+ int ld = (int)value(LINEDISC);
+
+ ioctl(FD, TIOCSETD, &ld);
+}
+
+/*
* Send a break.
*/
/*ARGSUSED*/