about summary refs log tree commit homepage
path: root/lib/PublicInbox/Lock.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-20 19:04:03 +0900
committerEric Wong <e@80x24.org>2021-03-21 09:45:46 +0000
commit7d2e572aca7297ea2015d2b6e7c71b672521ec82 (patch)
tree072f2f81930af5a84091431171c8af43e0584011 /lib/PublicInbox/Lock.pm
parent592daf02926f747bacaa85a1d1509374c7e66f11 (diff)
downloadpublic-inbox-7d2e572aca7297ea2015d2b6e7c71b672521ec82.tar.gz
This will be used for keyword (and label) storage for externals.
We'll be using this to ensure we don't redundantly auto-import
messages into lei/store if they're already in a local external
(they can still be imported explicitly via "lei import").
Diffstat (limited to 'lib/PublicInbox/Lock.pm')
-rw-r--r--lib/PublicInbox/Lock.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/Lock.pm b/lib/PublicInbox/Lock.pm
index 76c3ffb2..0ee2a8bd 100644
--- a/lib/PublicInbox/Lock.pm
+++ b/lib/PublicInbox/Lock.pm
@@ -16,7 +16,7 @@ sub lock_acquire {
         my $lock_path = $self->{lock_path};
         croak 'already locked '.($lock_path // '(undef)') if $self->{lockfh};
         return unless defined($lock_path);
-        sysopen(my $lockfh, $lock_path, O_WRONLY|O_CREAT) or
+        sysopen(my $lockfh, $lock_path, O_RDWR|O_CREAT) or
                 croak "failed to open $lock_path: $!\n";
         flock($lockfh, LOCK_EX) or croak "lock $lock_path failed: $!\n";
         $self->{lockfh} = $lockfh;