From 52808668d32625ede214265d7fc10e0886d94766 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Sun, 6 May 2012 23:41:16 +0200 Subject: [PATCH] Remove any old data on open(bridge) --- tools/mesh/lib/r0ket.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/mesh/lib/r0ket.pm b/tools/mesh/lib/r0ket.pm index 62741fb..9920b91 100755 --- a/tools/mesh/lib/r0ket.pm +++ b/tools/mesh/lib/r0ket.pm @@ -336,6 +336,10 @@ sub r0ket_init{ $term->setcc(VMIN,0); $term->setattr(fileno($bridge),TCSANOW); + #empty buffer, in case there is old data + my $dummy; + sysread($bridge,$dummy,1024); + return $ser; };