]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
spawn: be quiet about missing Inline.pm
authorEric Wong <e@80x24.org>
Fri, 24 Oct 2025 18:53:56 +0000 (18:53 +0000)
committerEric Wong <e@80x24.org>
Sat, 25 Oct 2025 09:37:03 +0000 (09:37 +0000)
Inline::C is optional may be dropped entirely future releases,
so don't spew confusing warnings to stderr about it being
missing.

lib/PublicInbox/Spawn.pm

index 7bad71193d50cee6c3fd7f959a16dea88ef47c54..9cb4865778d0e8101ebe569b5266d25ef19aca5e 100644 (file)
@@ -326,11 +326,13 @@ EOM
                open STDERR, '>&', $fh;
                STDERR->autoflush(1);
                STDOUT->autoflush(1);
+               my $have_inline;
                eval {
                        require Inline;
+                       $have_inline = 1;
                        Inline->import(C => $all_libc, BUILD_NOISY => 1);
                };
-               my $err = $@;
+               my $err = $have_inline ? $@ : ($all_libc = undef);
                open(STDERR, '>&', $olderr);
                open(STDOUT, '>&', $oldout);
                if ($err) {