diff options
author | Eric Wong <e@80x24.org> | 2020-12-31 13:51:49 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-01-01 05:00:40 +0000 |
commit | d59a9cb667f106b29363795539b55116077bcd80 (patch) | |
tree | 759a3964b8f74a5a6a99c6c2545f467e465813e8 /lib/PublicInbox/Git.pm | |
parent | 2b5d41f3a1b55ae513e9d5510d830074234fda37 (diff) | |
download | public-inbox-d59a9cb667f106b29363795539b55116077bcd80.tar.gz |
This simplifies our code and provides a more consistent API for error handling. PublicInbox::DS can be loaded nowadays on all *BSDs and Linux distros easily without extra packages to install. The downside is possibly increased startup time, but it's probably not as a big problem with lei being a daemon (and -mda possibly following suite).
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r-- | lib/PublicInbox/Git.pm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 73dc7d3e..fdfe1269 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -21,6 +21,7 @@ use PublicInbox::Tmpfile; use IO::Poll qw(POLLIN); use Carp qw(croak); use Digest::SHA (); +use PublicInbox::DS qw(dwaitpid); our @EXPORT_OK = qw(git_unquote git_quote); our $PIPE_BUFSIZ = 65536; # Linux default our $in_cleanup; @@ -326,10 +327,7 @@ sub _destroy { # GitAsyncCat::event_step may delete {pid} my $p = delete $self->{$pid} or return; - - # PublicInbox::DS may not be loaded - eval { PublicInbox::DS::dwaitpid($p, undef, undef) }; - waitpid($p, 0) if $@; # wait synchronously if not in event loop + dwaitpid $p; } sub cat_async_abort ($) { |