Skip to content

Commit

Permalink
Brm::Lasic: Work around kernel icanon race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
pasky committed Dec 28, 2011
1 parent 360e733 commit 77df400
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions perl/Brm/Lasic.pm
Expand Up @@ -90,6 +90,7 @@ sub BUILD {
$self->port->parity("none");
$self->port->stopbits(1);
$self->port->handshake("none");
$self->port->stty_icanon(0);
$self->port->write_settings();
$self->port->read_const_time(500);
# Yes, output record separator != input record separator!
Expand Down Expand Up @@ -177,9 +178,10 @@ sub msg {
print $fd join(' ', @args);
my $msg;
do {
$msg = <$fd>;
# $msg = <$fd> tends to induce writes stuck in the kernel?!
$msg = $self->port()->lookfor(1);
} while (not $msg);
# print "(rep: $msg)\n";
# print "\t(rep: $msg)\n";
}

=back
Expand Down

0 comments on commit 77df400

Please sign in to comment.