diff options
author | Eric Wong <e@80x24.org> | 2023-09-26 07:44:40 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-09-26 21:02:48 +0000 |
commit | 72ccceeb02542dda09b8a641c2bd17dd74440cc2 (patch) | |
tree | 86e365e53e986624a7d623e164c3e60f46a53470 /lib/PublicInbox/LeiMirror.pm | |
parent | 344897c0b27e061e41f2660f3c7a3de9a7b78452 (diff) | |
download | public-inbox-72ccceeb02542dda09b8a641c2bd17dd74440cc2.tar.gz |
It's basically the `system' perlop with support for env overrides, redirects, chdir, rlimits, and setpgid support.
Diffstat (limited to 'lib/PublicInbox/LeiMirror.pm')
-rw-r--r-- | lib/PublicInbox/LeiMirror.pm | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index fed6b668..c99bafc3 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -7,7 +7,7 @@ use v5.12; use parent qw(PublicInbox::IPC); use IO::Uncompress::Gunzip qw(gunzip $GunzipError); use IO::Compress::Gzip qw(gzip $GzipError); -use PublicInbox::Spawn qw(popen_rd spawn run_die); +use PublicInbox::Spawn qw(popen_rd spawn run_wait run_die); use File::Path (); use File::Temp (); use File::Spec (); @@ -251,8 +251,7 @@ sub index_cloned_inbox { sub run_reap { my ($lei, $cmd, $opt) = @_; $lei->qerr("# @$cmd"); - waitpid(spawn($cmd, undef, $opt), 0) // die "waitpid: $!"; - my $ret = $?; + my $ret = run_wait($cmd, undef, $opt); $? = 0; # don't let it influence normal exit $ret; } @@ -424,8 +423,7 @@ sub fgrp_fetch_all { my $c = [ @$cmd, '--unset-all', $_ ]; $self->{lei}->qerr("# @$c"); next if $self->{dry_run}; - my $pid = spawn($c, undef, $opt); - waitpid($pid, 0) // die "waitpid: $!"; + run_wait($c, undef, $opt); die "E: @$c \$?=$?" if ($? && ($? >> 8) != 5); } |