diff options
-rw-r--r-- | debian/changelog | 3 | ||||
-rwxr-xr-x | dgit | 25 |
2 files changed, 27 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index d8827a4..203a864 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,8 @@ dgit (2.2) unstable; urgency=low * Fix config relating to Debian to actually make split brain mode work. Closes:#841085. - * + * Detect SIGPIPE (and SIGCHLD) being blocked or ignored. + Closes:#841085. -- @@ -5222,6 +5222,30 @@ sub parseopts () { } } +sub check_env_sanity () { + my $blocked = new POSIX::SigSet; + sigprocmask SIG_UNBLOCK, $blocked, $blocked or die $!; + + eval { + foreach my $name (qw(PIPE CHLD)) { + my $signame = "SIG$name"; + my $signum = eval "POSIX::$signame" // die; + ($SIG{$name} // 'DEFAULT') eq 'DEFAULT' or + die "$signame is set to something other than SIG_DFL\n"; + $blocked->ismember($signum) and + die "$signame is blocked\n"; + } + }; + return unless $@; + chomp $@; + fail <<END; +On entry to dgit, $@ +This is a bug produced by something in in your execution environment. +Giving up. +END +} + + sub finalise_opts_opts () { foreach my $k (keys %opts_opt_map) { my $om = $opts_opt_map{$k}; @@ -5257,6 +5281,7 @@ if ($ENV{$fakeeditorenv}) { } parseopts(); +check_env_sanity(); git_slurp_config(); print STDERR "DRY RUN ONLY\n" if $dryrun_level > 1; |