Remove any old data on open(bridge)

This commit is contained in:
Stefan `Sec` Zehl 2012-05-06 23:41:16 +02:00
parent a5ae20daff
commit 52808668d3
1 changed files with 4 additions and 0 deletions

View File

@ -336,6 +336,10 @@ sub r0ket_init{
$term->setcc(VMIN,0); $term->setcc(VMIN,0);
$term->setattr(fileno($bridge),TCSANOW); $term->setattr(fileno($bridge),TCSANOW);
#empty buffer, in case there is old data
my $dummy;
sysread($bridge,$dummy,1024);
return $ser; return $ser;
}; };