my @cmd = (qw/git config/, "--file=$file", '-l');
my $cmd = join(' ', @cmd);
my $pid = open(my $fh, '-|', @cmd);
- defined $pid or die "$cmd failed: $!\n";
+ defined $pid or die "$cmd failed: $!";
my %rv;
foreach my $line (<$fh>) {
chomp $line;
$rv{$k} = $v;
}
}
- close $fh or die "failed to close ($cmd) pipe: $!\n";
- $? and warn "$$ $cmd exited with: ($pid) $?\n";
+ close $fh or die "failed to close ($cmd) pipe: $!";
+ $? and warn "$$ $cmd exited with: ($pid) $?";
\%rv;
}
warn "error binding $l: $!\n";
}
}
- die 'No listeners bound' unless @listeners;
+ die "No listeners bound\n" unless @listeners;
}
sub daemonize () {
- chdir '/' or die "chdir failed: $!\n";
- open(STDIN, '+<', '/dev/null') or die "redirect stdin failed: $!\n";
+ chdir '/' or die "chdir failed: $!";
+ open(STDIN, '+<', '/dev/null') or die "redirect stdin failed: $!";
return unless (defined $pid_file || defined $group || defined $user
|| $daemonize);
my $new = POSIX::SigSet->new;
$new->fillset;
my $old = POSIX::SigSet->new;
- POSIX::sigprocmask(&POSIX::SIG_BLOCK, $new, $old) or
- die "SIG_BLOCK: $!\n";
+ POSIX::sigprocmask(&POSIX::SIG_BLOCK, $new, $old) or die "SIG_BLOCK: $!";
my $pid = fork;
my $err = $!;
- POSIX::sigprocmask(&POSIX::SIG_SETMASK, $old) or
- die "SIG_SETMASK: $!\n";
+ POSIX::sigprocmask(&POSIX::SIG_SETMASK, $old) or die "SIG_SETMASK: $!";
($pid, $err);
}
return unless $pid_file;
my $file = $pid_file;
- $file =~ s/\.oldbin\z// or die "BUG: no '.oldbin' suffix in $file\n";
+ $file =~ s/\.oldbin\z// or die "BUG: no '.oldbin' suffix in $file";
unlink_pid_file_safe_ish($$, $pid_file);
$pid_file = $file;
eval { write_pid($pid_file) };
}
sub master_loop {
- pipe(my ($p0, $p1)) or die "failed to create parent-pipe: $!\n";
- pipe(my ($r, $w)) or die "failed to create self-pipe: $!\n";
+ pipe(my ($p0, $p1)) or die "failed to create parent-pipe: $!";
+ pipe(my ($r, $w)) or die "failed to create self-pipe: $!";
IO::Handle::blocking($w, 0);
my $set_workers = $worker_processes;
my @caught;