#endif /* defined(CMSG_SPACE) && defined(CMSG_LEN) */
ALL_LIBC
- 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';
warn "$inline_dir exists, not writable\n" if -e $inline_dir && !-w _;
$all_libc = undef unless -d _ && -w _;
if (defined $all_libc) {
+ local $ENV{PERL_INLINE_DIRECTORY} = $inline_dir;
my $f = "$inline_dir/.public-inbox.lock";
open my $oldout, '>&', \*STDOUT or die "dup(1): $!";
open my $olderr, '>&', \*STDERR or die "dup(2): $!";
$all_libc = undef;
}
}
- unless ($all_libc) {
+ if (defined $all_libc) { # set for Gcf2
+ $ENV{PERL_INLINE_DIRECTORY} = $inline_dir;
+ } else {
require PublicInbox::SpawnPP;
*pi_fork_exec = \&PublicInbox::SpawnPP::pi_fork_exec
}
$opt->{1} = fileno($w);
my $pid = spawn($cmd, $env, $opt);
return ($r, $pid) if wantarray;
- my $ret = gensym;
- tie *$ret, 'PublicInbox::ProcessPipe', $pid, $r, @$opt{qw(cb arg)};
- $ret;
+ my $s = gensym;
+ tie *$s, 'PublicInbox::ProcessPipe', $pid, $r, @{$opt->{cb_arg} // []};
+ $s;
}
sub run_die ($;$$) {