* [PATCH] spawn: fix compatibility with old Inline::C
@ 2020-05-21 5:18 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2020-05-21 5:18 UTC (permalink / raw)
To: meta
Older versions of Inline (e.g. 0.53 in CentOS 7) did not accept
the `directory' parameter, so use conditional assignment to set
a default value on $ENV{PERL_INLINE_DIRECTORY}, instead.
---
lib/PublicInbox/Spawn.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm
index 785ea865..888283d0 100644
--- a/lib/PublicInbox/Spawn.pm
+++ b/lib/PublicInbox/Spawn.pm
@@ -141,7 +141,7 @@ int pi_fork_exec(SV *redirref, SV *file, SV *cmdref, SV *envref, SV *rlimref,
}
VFORK_SPAWN
-my $inline_dir = $ENV{PERL_INLINE_DIRECTORY} // (
+my $inline_dir = $ENV{PERL_INLINE_DIRECTORY} //= (
$ENV{XDG_CACHE_HOME} //
( ($ENV{HOME} // '/nonexistent').'/.cache' )
).'/public-inbox/inline-c';
@@ -155,7 +155,7 @@ if (defined $vfork_spawn) {
my $f = "$inline_dir/.public-inbox.lock";
open my $fh, '>', $f or die "failed to open $f: $!\n";
flock($fh, LOCK_EX) or die "LOCK_EX failed on $f: $!\n";
- eval 'use Inline C => $vfork_spawn, directory => $inline_dir';
+ eval 'use Inline C => $vfork_spawn';
my $err = $@;
flock($fh, LOCK_UN) or die "LOCK_UN failed on $f: $!\n";
die $err if $err;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-05-21 5:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 5:18 [PATCH] spawn: fix compatibility with old Inline::C Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).