about summary refs log tree commit homepage
path: root/lib/PublicInbox/Msgmap.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-08-08 04:59:48 +0000
committerEric Wong <e@yhbt.net>2020-08-08 10:47:11 +0000
commit683e5fbbfef867ff04b376b3d5230976004a6c7a (patch)
tree85b6cb3b3f40d88a51cf3b1d6902373f6318a836 /lib/PublicInbox/Msgmap.pm
parent6e98887b3d539dd07c9d49e3334e48d720fc1e31 (diff)
downloadpublic-inbox-683e5fbbfef867ff04b376b3d5230976004a6c7a.tar.gz
support setting No_COW on Perl <5.22
fileno(DIRHANDLE) only works on Perl 5.22+, so we need to use
dirfd(3) ourselves from Inline::C (or rely on chattr(1) being
installed).

While we're at it, rename `set_nodatacow' to `nodatacow_fd'
for consistency with `nodatacow_dir'.
Diffstat (limited to 'lib/PublicInbox/Msgmap.pm')
-rw-r--r--lib/PublicInbox/Msgmap.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm
index eee8d6ca..e7f7e2c9 100644
--- a/lib/PublicInbox/Msgmap.pm
+++ b/lib/PublicInbox/Msgmap.pm
@@ -51,7 +51,7 @@ sub new_file {
 sub tmp_clone {
         my ($self, $dir) = @_;
         my ($fh, $fn) = tempfile('msgmap-XXXXXXXX', EXLOCK => 0, DIR => $dir);
-        PublicInbox::Spawn::set_nodatacow(fileno($fh));
+        PublicInbox::Spawn::nodatacow_fd(fileno($fh));
         my $tmp;
         if ($self->{dbh}->can('sqlite_backup_to_dbh')) {
                 $tmp = ref($self)->new_file($fn, 2);