mirror of
https://github.com/brmlab/lasic.git
synced 2025-06-07 16:54:00 +02:00
Brm::Lasic: Work around kernel icanon race condition
This commit is contained in:
parent
360e7338b8
commit
77df4005ec
1 changed files with 4 additions and 2 deletions
|
@ -90,6 +90,7 @@ sub BUILD {
|
||||||
$self->port->parity("none");
|
$self->port->parity("none");
|
||||||
$self->port->stopbits(1);
|
$self->port->stopbits(1);
|
||||||
$self->port->handshake("none");
|
$self->port->handshake("none");
|
||||||
|
$self->port->stty_icanon(0);
|
||||||
$self->port->write_settings();
|
$self->port->write_settings();
|
||||||
$self->port->read_const_time(500);
|
$self->port->read_const_time(500);
|
||||||
# Yes, output record separator != input record separator!
|
# Yes, output record separator != input record separator!
|
||||||
|
@ -177,9 +178,10 @@ sub msg {
|
||||||
print $fd join(' ', @args);
|
print $fd join(' ', @args);
|
||||||
my $msg;
|
my $msg;
|
||||||
do {
|
do {
|
||||||
$msg = <$fd>;
|
# $msg = <$fd> tends to induce writes stuck in the kernel?!
|
||||||
|
$msg = $self->port()->lookfor(1);
|
||||||
} while (not $msg);
|
} while (not $msg);
|
||||||
# print "(rep: $msg)\n";
|
# print "\t(rep: $msg)\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue