about summary refs log tree commit homepage
path: root/lib/PublicInbox/Msgmap.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/Msgmap.pm')
-rw-r--r--lib/PublicInbox/Msgmap.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm
index 38ec7858..9d2ef0dc 100644
--- a/lib/PublicInbox/Msgmap.pm
+++ b/lib/PublicInbox/Msgmap.pm
@@ -238,22 +238,21 @@ sub DESTROY {
 
 sub atfork_parent {
         my ($self) = @_;
-        $self->{pid} or die "not a temporary clone\n";
-        my $dbh = $self->{dbh} and die "tmp_clone dbh not prepared for parent";
-        $self->{filename} = $dbh->sqlite_db_filename;
-        $dbh = $self->{dbh} = PublicInbox::Over::dbh_new($self, 1);
+        $self->{pid} or die 'BUG: not a temporary clone';
+        $self->{dbh} and die 'BUG: tmp_clone dbh not prepared for parent';
+        defined($self->{filename}) or die 'BUG: {filename} not defined';
+        my $dbh = $self->{dbh} = PublicInbox::Over::dbh_new($self, 1);
         $dbh->do('PRAGMA synchronous = OFF');
 }
 
 sub atfork_prepare {
         my ($self) = @_;
-        $self->{pid} or die "not a temporary clone\n";
-        $self->{pid} == $$ or
-                die "BUG: atfork_prepare not called from $self->{pid}\n";
-        my $dbh = $self->{dbh} or die "temporary clone not open\n";
+        my $pid = $self->{pid} or die 'BUG: not a temporary clone';
+        $pid == $$ or die "BUG: atfork_prepare not called by $pid";
+        my $dbh = $self->{dbh} or die 'BUG: temporary clone not open';
 
         # must clobber prepared statements
-        %$self = (filename => $dbh->sqlite_db_filename, pid => $$);
+        %$self = (filename => $dbh->sqlite_db_filename, pid => $pid);
 }
 
 sub skip_artnum {