Unverified Commit cf22cd26 authored by boklm's avatar boklm
Browse files

Bug 40791: Make sure dmg2mar exits with an error when something failed

If the child process failed, make sure we exit with an error in the
parent process too.
parent a22a592f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -106,7 +106,11 @@ sub get_dmg_files_from_sha256sums {
sub convert_files {
    my ($channel) = @_;
    my $pm = Parallel::ForkManager->new(get_nbprocs);
    $pm->run_on_finish(sub { print "Finished $_[2]\n" });
    $pm->run_on_finish(
      sub {
        exit_error "Failed while running $_[2]" unless $_[1] == 0;
        print "Finished $_[2]\n";
      });
    foreach my $file (get_dmg_files_from_sha256sums) {
        # The 'ja' locale is a special case: it is called 'ja-JP-mac'
        # internally on OSX, but the dmg file still uses 'ja' to avoid