lib/PublicInbox/Config.pm | 6 +++--- lib/PublicInbox/Daemon.pm | 18 ++++++++---------- lib/PublicInbox/NNTP.pm | 2 +- lib/PublicInbox/WWW.pm | 2 +- diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index b51163883317fea824a4b7492f1c91149747054d..f84a9550b6c9a63f04477d8a2fee541c51e3382c 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -73,7 +73,7 @@ my ($in, $out); 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; @@ -90,8 +90,8 @@ } else { $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; } diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index b8482d36c6de884c200872417d22f96459730994..45c1563478a3c9adfa3ccd33de566d2bb0605c0b 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -67,12 +67,12 @@ } else { 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); @@ -238,12 +238,10 @@ sub do_fork () { 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); } @@ -254,7 +252,7 @@ $reexec_pid = undef; 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) }; @@ -289,8 +287,8 @@ } } 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; diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index bcce77038dd124990459c38f235702151138a31f..fbf8f7f283b4d6337fda5d60da94accc38068f53 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -229,7 +229,7 @@ my ($date, $time, $gmt) = @_; use Time::Local qw(); my ($hh, $mm, $ss) = unpack('A2A2A2', $time); if (defined $gmt) { - $gmt =~ /\A(?:UTC|GMT)\z/i or die "GM invalid: $gmt\n"; + $gmt =~ /\A(?:UTC|GMT)\z/i or die "GM invalid: $gmt"; $gmt = 1; } my @now = $gmt ? gmtime : localtime; diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 2da819b18e698753fa73b1297d510af7d263f2ae..98e33fd362fa7f277a544cb60d59ff5a5fe31adb 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -244,7 +244,7 @@ sub ctx_get { my ($ctx, $key) = @_; my $val = $ctx->{$key}; - (defined $val && $val ne '') or die "BUG: bad ctx, $key unusable\n"; + (defined $val && $val ne '') or die "BUG: bad ctx, $key unusable"; $val; }