summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2003-08-13 08:33:03 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2003-08-13 08:33:03 +0000
commit3dcabf584ce175350348728b9812a2936494bf4d (patch)
treede750ee02e36169793fde1af01ae7375243a5c1e
parent9e4252de3e478cf61f3bb7f3f14ae98048faa00e (diff)
use more portable tcsendbreak(3) and ignore break_length;
ok deraadt, millert
-rw-r--r--usr.bin/ssh/session.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index c7f5eb36b85..3a866532a47 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -33,7 +33,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.159 2003/07/22 13:35:22 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.160 2003/08/13 08:33:02 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -1460,18 +1460,12 @@ session_break_req(Session *s)
{
u_int break_length;
- break_length = packet_get_int();
+ break_length = packet_get_int(); /* ignored */
packet_check_eom();
- if (s->ttyfd == -1)
+ if (s->ttyfd == -1 ||
+ tcsendbreak(s->ttyfd, 0) < 0)
return 0;
- /* we will sleep from 500ms to 3000ms */
- break_length = MIN(break_length, 3000);
- break_length = MAX(break_length, 500);
- ioctl(s->ttyfd, TIOCSBRK, NULL);
- /* should we care about EINTR? */
- usleep(break_length * 1000);
- ioctl(s->ttyfd, TIOCCBRK, NULL);
return 1;
}