summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2006-06-17 00:47:16 +0000
committerderaadt <deraadt@openbsd.org>2006-06-17 00:47:16 +0000
commit6b4725ab60d48669f5ec14cef3146410b0e48954 (patch)
tree02e3db82395478ffb8671037631af97eb07f572b
parentsync (diff)
downloadwireguard-openbsd-6b4725ab60d48669f5ec14cef3146410b0e48954.tar.xz
wireguard-openbsd-6b4725ab60d48669f5ec14cef3146410b0e48954.zip
avoid missing events for timestamping (dcd change at same time as cts);
mrd@alkemio.org
-rw-r--r--sys/kern/tty.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 6e64e24c672..c6c94bcbfff 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.70 2006/04/27 19:30:28 deraadt Exp $ */
+/* $OpenBSD: tty.c,v 1.71 2006/06/17 00:47:16 deraadt Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -2345,13 +2345,13 @@ ttytstamp(struct tty *tp, int octs, int ncts, int odcd, int ndcd)
{
int doit = 0;
- if (ncts ^ octs) {
- doit = (ncts && ISSET(tp->t_flags, TS_TSTAMPCTSSET)) ||
- (!ncts && ISSET(tp->t_flags, TS_TSTAMPCTSCLR));
- } else if (ndcd ^ odcd) {
- doit = (ndcd && ISSET(tp->t_flags, TS_TSTAMPDCDSET)) ||
- (!ndcd && ISSET(tp->t_flags, TS_TSTAMPDCDCLR));
- }
+ if (ncts ^ octs)
+ doit |= ncts ? ISSET(tp->t_flags, TS_TSTAMPCTSSET) :
+ ISSET(tp->t_flags, TS_TSTAMPCTSCLR);
+ if (ndcd ^ odcd)
+ doit |= ndcd ? ISSET(tp->t_flags, TS_TSTAMPDCDSET) :
+ ISSET(tp->t_flags, TS_TSTAMPDCDCLR);
+
if (doit)
microtime(&tp->t_tv);
}