diff options
author | Eric Wong <e@80x24.org> | 2023-10-07 21:24:09 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-08 18:54:48 +0000 |
commit | ed1ad9b3b6ea3e6e22deaaf54fdc8230a3b09b8c (patch) | |
tree | dce43f04eaf5818ab783bcc859001c4e34fd618e /lib/PublicInbox/Qspawn.pm | |
parent | 1661ff8e21f3cb1df1a3fc00d917f404f4eae734 (diff) | |
download | public-inbox-ed1ad9b3b6ea3e6e22deaaf54fdc8230a3b09b8c.tar.gz |
Specifying {cb_args} in the options hash felt awkward to me. Instead, just use the Perl stack like we do with awaitpid() and pass the list down directly.
Diffstat (limited to 'lib/PublicInbox/Qspawn.pm')
-rw-r--r-- | lib/PublicInbox/Qspawn.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/Qspawn.pm b/lib/PublicInbox/Qspawn.pm index ea7ae647..0e52617c 100644 --- a/lib/PublicInbox/Qspawn.pm +++ b/lib/PublicInbox/Qspawn.pm @@ -58,10 +58,10 @@ sub _do_spawn { } $self->{cmd} = $cmd; $self->{-quiet} = 1 if $o{quiet}; - $o{cb_arg} = [ \&waitpid_err, $self ]; eval { # popen_rd may die on EMFILE, ENFILE - $self->{rpipe} = popen_rd($cmd, $cmd_env, \%o) // die "E: $!"; + $self->{rpipe} = popen_rd($cmd, $cmd_env, \%o, + \&waitpid_err, $self); $limiter->{running}++; $start_cb->($self); # EPOLL_CTL_ADD may ENOSPC/ENOMEM }; |