diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-11 23:31:37 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-12 00:31:20 +0000 |
commit | fcb31fe3655f197956bb61f89c54638db4c14265 (patch) | |
tree | a804d96ab6bc155f457eb0b1af00770ae5298131 /dgit | |
parent | f04599680685ea8f89bff8bc76e3dad2f8028081 (diff) |
dgit: Do not execute END blocks in children.
END blocks run inside children created by fork or piped open (the
latter, if they run perl code), on exit or (I think maybe) die. This
is far from appropriate.
So far symptoms of this bug seem to be limited to duplicated error
messages but I have not done a thorough analysis. Closes:#850052.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -156,6 +156,7 @@ our $split_brain = 0; END { local ($@, $?); + return unless forkcheck_mainprocess(); print STDERR "! $_\n" foreach $supplementary_message =~ m/^.+$/mg; } @@ -220,6 +221,7 @@ initdebug(''); our @end; END { local ($?); + return unless forkcheck_mainprocess(); foreach my $f (@end) { eval { $f->(); }; print STDERR "$us: cleanup: $@" if length $@; @@ -4473,7 +4475,10 @@ sub i_cleanup { } } -END { i_cleanup(); } +END { + return unless forkcheck_mainprocess(); + i_cleanup(); +} sub i_method { my ($base,$selector,@args) = @_; |