]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Over.pm
support setting No_COW on Perl <5.22
[public-inbox.git] / lib / PublicInbox / Over.pm
index f32743c05a8a461baf0c4f5a52c983d5fecd25af..2b314882bc4d9546ab567d523c8c9878d89b6d7b 100644 (file)
@@ -18,7 +18,12 @@ sub dbh_new {
        my $f = delete $self->{filename};
        if (!-f $f) { # SQLite defaults mode to 0644, we want 0666
                if ($rw) {
+                       require PublicInbox::Spawn;
                        open my $fh, '+>>', $f or die "failed to open $f: $!";
+                       PublicInbox::Spawn::nodatacow_fd(fileno($fh));
+                       my $j = "$f-journal";
+                       open $fh, '+>>', $j or die "failed to open $j: $!";
+                       PublicInbox::Spawn::nodatacow_fd(fileno($fh));
                } else {
                        $self->{filename} = $f; # die on stat() below:
                }