From 820f6fa94ce812feab7fe3b0361b53ad8ca442d8 Mon Sep 17 00:00:00 2001 From: Hidetoshi Shimokawa Date: Thu, 31 May 2007 04:55:05 +0000 Subject: [PATCH] Discard backlog on GDB port when connected. MFC after: 3 days --- usr.sbin/dconschat/dconschat.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr.sbin/dconschat/dconschat.c b/usr.sbin/dconschat/dconschat.c index e7dc004088c..9594c16b888 100644 --- a/usr.sbin/dconschat/dconschat.c +++ b/usr.sbin/dconschat/dconschat.c @@ -605,6 +605,16 @@ dconschat_accept_socket(struct dcons_state *dc, struct dcons_port *p) p->skip_read = 0; } #endif + /* discard backlog on GDB port */ + if (IS_GDB(p)) { + char buf[2048]; + int len; + + while ((len = dconschat_read_dcons(dc, DCONS_GDB, &buf[0], + 2048)) > 0) + if (verbose) + printf("discard %d chars on GDB port\n", len); + } p->infd = p->outfd = ns; EV_SET(&kev, ns, EVFILT_READ, EV_ADD, NOTE_LOWAT, 1, (void *)p);