chiark
/
gitweb
/
~mdw
/
with-authinfo-kludge
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60a565f
)
with-authinfo-kludge (accept_loop): Fix `select' error handling.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 24 Apr 2016 22:30:30 +0000
(23:30 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Tue, 26 Apr 2016 19:32:25 +0000
(20:32 +0100)
We shouldn't go through the file descriptors if select(2) failed: the
table is likely to be bobbins.
with-authinfo-kludge
patch
|
blob
|
blame
|
history
diff --git
a/with-authinfo-kludge
b/with-authinfo-kludge
index 91785cc504123542b6593a7b4fe1c07aac4d9498..2ba8969647574b0523f72f4b59e2e6817f7ffe14 100755
(executable)
--- a/
with-authinfo-kludge
+++ b/
with-authinfo-kludge
@@
-766,9
+766,11
@@
sub run_client (@) {
sub accept_loop () {
my $rfd_in = "";
for my $fd (keys %SERVMAP) { vec($rfd_in, $fd, 1) = 1; }
- for (;;) {
+
SELECT:
for (;;) {
my ($n, $t) = select my $rfd_out = $rfd_in, undef, undef, undef;
- $n >= 0 || $! == EINTR or sysfail "select failed: $!";
+ if ($n >= 0) { }
+ elsif ($! == EINTR) { next SELECT; }
+ else { sysfail "select failed: $!"; }
FD: for my $fd (keys %SERVMAP) {
next unless vec $rfd_out, $fd, 1;
my ($s, $a, $sk) = @{$SERVMAP{$fd}};