]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei-daemon: note FD count mismatch to client
authorEric Wong <e@80x24.org>
Wed, 28 Apr 2021 07:51:59 +0000 (07:51 +0000)
committerEric Wong <e@80x24.org>
Wed, 28 Apr 2021 19:30:56 +0000 (19:30 +0000)
This should help in some error diagnostics

lib/PublicInbox/LEI.pm

index ef72758c6d9a060ebe5813a7a8b0fbe8aca437a8..a949ae3e7c39175ed7d07c76f55ee1f1c6e19198 100644 (file)
@@ -998,7 +998,7 @@ sub accept_dispatch { # Listener {post_accept} callback
                        open($self->{$i++}, '+<&=', $fd) and next;
                        send($sock, "open(+<&=$fd) (FD=$i): $!", MSG_EOR);
                }
-               return if scalar(@fds) != 4;
+               $i == 4 or return send($sock, 'not enough FDs='.($i-1), MSG_EOR)
        }
        $self->{2}->autoflush(1); # keep stdout buffered until x_it|DESTROY
        # $ENV_STR = join('', map { "\0$_=$ENV{$_}" } keys %ENV);